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