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
As @Johann says, the ConditionalAttribute
is probably the cleanes solution here:
[Conditional("DEBUG")]
private void InitializeDb()
{
// Initializer code here
// DropCreateDatabaseOnModelChange
}
and in Global.asax:
public void Application_Start // or wherever it is you're initializing
{
// This will only be called if the DEBUG constant is defined
InitializeDb();
}