我们如何在asp.net core中使用数据迁移?我已经尝试查看asp.net core文档,但没有找到相关内容。
以下是asp.net 4的代码:
internal sealed class Configuration : DbMigrationsConfiguration<ApplicationDbContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
}
protected override void Seed(ApplicationDbContext context)
{
base.Seed(context);
//Add stuff to database
context.SaveChanges();
}
}
在asp.net core中的等效方法是什么?