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