Skip to content

Instantly share code, notes, and snippets.

@szul
Created June 16, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szul/fd5484e3e7c97283f29f to your computer and use it in GitHub Desktop.
Save szul/fd5484e3e7c97283f29f to your computer and use it in GitHub Desktop.
Turning off code first migrations in ASP.NET MVC and Web API for when legacy databases are used
protected void Application_Start()
{
//Where DatabaseContext is the class name of your database context for MVC/Web API
Database.SetInitializer<DatabaseContext>(null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment