I am attempting to deploy my first alpha version of a system online for a few people to start using. On development I make heavy use of the DropCreateDatabaseOnModelC
What about inversion of control:
var initializer = container.Resolve>();
Database.SetInitializer(initializer);
Based on your IoC configuration you will either return developement or production initializer. You can have different configuration file for each build configuration so you can also have IoC container configured differently.
public class ThrowExceptionInitializer : IDatabaseInitializer
{
public InitializeDatabase(Context context)
{
// Custom exception
throw new InvalidVersionException("The new application version is not supported by the database version");
}
}