How can I disable migration in Entity Framework 6.0

ef-migrations entity entity-framework

Question

Using Entity Framework 6.0 rc1, I'm attempting to disregard the "Automatic" migration. The fact that I don't want this feature at the moment is my problem, and every time my application runs, I can see all entity logs attempting to generate all tables.

Expect to be thanked.

1
65
6/8/2015 11:18:05 AM

Accepted Answer

Do this:

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

UPDATE:

Alternatively, try this:

Database.SetInitializer<YourContextType>(new CreateDatabaseIfNotExists());
46
9/8/2013 3:20:33 AM

Popular Answer

ZZZ_tmp


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow