Exemplo n.º 1
0
        public IdentityServerDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <IdentityServerDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            IdentityServerDbContextConfigurer.Configure(builder, configuration.GetConnectionString(IdentityServerConsts.ConnectionStringName));

            return(new IdentityServerDbContext(builder.Options));
        }
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <IdentityServerDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 IdentityServerDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 IdentityServerDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }