How to disable migration in Entity Framework 4.3.1?

前端 未结 3 707
一向
一向 2020-12-01 10:23

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 wo

3条回答
  •  無奈伤痛
    2020-12-01 11:08

    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(new CreateDatabaseIfNotExists());
    

提交回复
热议问题