How can I disable migration in Entity Framework 6.0

后端 未结 7 1562
傲寒
傲寒 2020-11-29 01:24

I\'m trying to ignore the \"Automatic\" migration using Entity Framework 6.0 rc1. My problem is that I don\'t want this feature right now and every time that my application

7条回答
  •  没有蜡笔的小新
    2020-11-29 02:04

    Try this:

    internal sealed class Configuration : DbMigrationsConfiguration
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }
    }
    

    UPDATE:

    You can also try this:

    Database.SetInitializer(new CreateDatabaseIfNotExists());
    

提交回复
热议问题