예제 #1
0
        public static void CreateAndMigrateDatabase(bool useDevData = false)
        {
            Console.WriteLine("Creating Contexts");
            var configContext         = new ConfigurationContextDesignTimeFactory().CreateDbContext(null);
            var persistedGrantContext = new PersistedGrantContextDesignTimeFactory().CreateDbContext(null);
            var identityB2CContext    = new IdentityB2CContextFactory().CreateDbContext(null);

            Console.WriteLine("Migrating database");
            configContext.Database.Migrate();
            persistedGrantContext.Database.Migrate();
            identityB2CContext.Database.Migrate();

            Console.WriteLine("Seeding Identity Data");
            Seed.SeedIdentityData(configContext);

            Console.WriteLine("Complete.");
        }
예제 #2
0
파일: Program.cs 프로젝트: tarun04/MonoRepo
        static void Main(string[] args)
        {
            Console.WriteLine("Creating contexts");
            var configContext         = new ConfigurationContextDesignTimeFactory().CreateDbContext(null);
            var persistedGrantContext = new PersistedGrantContextDesignTimeFactory().CreateDbContext(null);
            var identityB2BContext    = new IdentityB2BContextFactory().CreateDbContext(null);

            Console.WriteLine("Migrating database");
            configContext.Database.Migrate();
            persistedGrantContext.Database.Migrate();
            identityB2BContext.Database.Migrate();

            Console.WriteLine("Seeding Identity data");
            Seed.SeedIdentityData(configContext);

            Console.WriteLine("Complete.");
        }