How to disable migration in Entity Framework 4.3.1

code-firstentity-framework-4.3entity-framework-migrations

Is there any way to disable migration in Entity Framework 4.3.1? I removed the migrations folder from the project and the generated tables in my database, but it doesn't work! How can you remove the migration?

Best Answer

If you don't want to use migrations but in the same time you want EF to create database for you, you just need to set correct database initializer:

Database.SetInitializer<YourContextType>(new CreateDatabaseIfNotExists<YourContentType>());