public CompanyNameProjectNameMigrationsDbContext CreateDbContext(string[] args) { CompanyNameProjectNameEfCoreEntityExtensionMappings.Configure(); var configuration = BuildConfiguration(); //var builder = new DbContextOptionsBuilder<CompanyNameProjectNameMigrationsDbContext>() // .UseSqlServer(configuration.GetConnectionString("Default")); var builder = new DbContextOptionsBuilder <CompanyNameProjectNameMigrationsDbContext>() .UseMySql(configuration.GetConnectionString("Default"), new MySqlServerVersion(new Version(5, 7)), mySqlOptions => mySqlOptions .CharSetBehavior(CharSetBehavior.NeverAppend)); return(new CompanyNameProjectNameMigrationsDbContext(builder.Options)); }
public override void PreConfigureServices(ServiceConfigurationContext context) { CompanyNameProjectNameEfCoreEntityExtensionMappings.Configure(); }