How to apply migrations from code
for EF6 work code
Database.SetInitializer(null); var settings = new MigrationsConfiguratio
For Entity Framework Core 1.0.0, ensure you have the Microsoft.EntityFrameworkCore.Relational NuGet package. Then import this namespace:
Microsoft.EntityFrameworkCore.Relational
using Microsoft.EntityFrameworkCore;
Finally, get hold of a DbContext and run:
DbContext
context.Database.Migrate();