Entity Framework CTP 4 - Code First Custom Database Initializer
问题 I would like to implement a custom database initialization strategy so that I can generate the database schema and apply it to an EXISTING EMPTY SQL database using a supplied User ID and Password. Unfortunately the built-in strategies don’t provide what I’m looking for: // The default strategy creates the DB only if it doesn\'t exist - but it does // exist so this does nothing Database.SetInitializer(new CreateDatabaseOnlyIfNotExists<DataContext>()); // Drops and re-creates the database but