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