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