Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

A OpenMod plugin which adds the ability to use Pomelo's MySQL EF Core.

License

Notifications You must be signed in to change notification settings

SilksPlugins/SilK.OpenMod.EntityFrameworkCore

Repository files navigation

SilK.OpenMod.EntityFrameworkCore

A OpenMod plugin which adds the ability to use Pomelo's MySQL EF Core.

DISCLAIMER: The hotloader for OpenMod cannot be disabled or else this won't work.

Usage

There are three steps to including SilK.OpenMod.EntityFrameworkCore in your OpenMod plugin:

  • Include the NuGet package in your project - Install-Package SilK.OpenMod.EntityFrameworkCore

  • Add the PomeloMySqlConnectorResolver to your container configurator:

    public class ContainerConfigurator : IContainerConfigurator
    {
        public void ConfigureContainer(IOpenModServiceConfigurationContext openModStartupContext,
            ContainerBuilder containerBuilder)
        {
            ...
            containerBuilder.AddPomeloMySqlConnectorResolver();
            ...
        }
    }
  • Change your database context's base type to OpenModPomeloDbContext<>:

    public class ExampleDbContext : OpenModDbContext<ExampleDbContext>
    {
        ...
    }

    to

    public class ExampleDbContext : OpenModPomeloDbContext<ExampleDbContext>
    {
        ...
    }

About

A OpenMod plugin which adds the ability to use Pomelo's MySQL EF Core.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages