There is no more
public Configuration()
{
AutomaticMigrationsEnabled = false;
}
in Entity Framework Core 1.0 (formerly EF 7.0)
Now you can use extension Migrate method during database initialization.
For example, you have custom DBInitializer class:
public class DBInitialization
{
public static void Initialize()
{
using (var context = new DbContext())
{
context.Database.Migrate();
// Other db initialization code.
}
}
}
There is also async version of this method. This method will apply any pending migrations.
You can call DBInitialization.Initialize at the end of Configure method at Startup class.