public MysqlMigrationDemoDbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder <MysqlMigrationDemoDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); MysqlMigrationDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MysqlMigrationDemoConsts.ConnectionStringName)); return(new MysqlMigrationDemoDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <MysqlMigrationDemoDbContext>(options => { if (options.ExistingConnection != null) { MysqlMigrationDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { MysqlMigrationDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } }