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