Пример #1
0
        public MyAppMigrationsDbContext CreateDbContext(string[] args)
        {
            MyAppEfCoreEntityExtensionMappings.Configure();

            var configuration = BuildConfiguration();

            var builder = new DbContextOptionsBuilder <MyAppMigrationsDbContext>()
                          .UseMySql(configuration.GetConnectionString("Default"), ServerVersion.FromString("8.0.21-mysql"));

            return(new MyAppMigrationsDbContext(builder.Options));
        }
Пример #2
0
 public override void PreConfigureServices(ServiceConfigurationContext context)
 {
     MyAppEfCoreEntityExtensionMappings.Configure();
 }