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