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