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