I have a code-first entity model in EF5. But I want to manage the database changes manually -- I do not want EF to modify my existing database and all its data. But when I make parallel changes in the EF mapping and in the database, EF refuses to operate properly telling me I need to use code first migration. How do I turn this off?
set the Database.SetInitializer to null.
public class DatabaseContext: DbContext
{
//the base accepts the name of the connection string provided in the web.config as a parameter
public DatabaseContext()
: base("DatabaseContext")
{
//disable initializer
Database.SetInitializer<DatabaseContext>(null);
}