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