예제 #1
0
        public void DropAndCreate()
        {
            DbContextValidator.Validate();
            var initalizer = new DbContextInitializer();

            initalizer.InitializeDatabase(_context);
        }
예제 #2
0
        public void Migrate()
        {
            DbContextValidator.Validate();
            var migratorConfiguration = new Configuration
            {
                TargetDatabase = new DbConnectionInfo(
                    _context.Database.Connection.ConnectionString, "System.Data.SqlClient")
            };
            var migrator = new DbMigrator(migratorConfiguration);

            migrator.Update();
        }