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