Exemple #1
0
        public IdentityServerWithEfCoreDemoDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <IdentityServerWithEfCoreDemoDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            IdentityServerWithEfCoreDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(IdentityServerWithEfCoreDemoConsts.ConnectionStringName));

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