好的,但是在配置过时之前我们使用的以下设置怎么样?
public Configuration()
{
//AutomaticMigrationsEnabled = true; //it is Ok for now as default value is true
//what about the following settings???
AutomaticMigrationDataLossAllowed = true; //Attention when using this!!!
MigrationsDirectory = @"Migrations";
ContextKey = "Demo.Domain.DemoDbContext";
}
我可以在哪里设置这些设置?
最佳答案
安装EntityFrameworkCore.Tools
包,以便在包管理器控制台中使用Add-Migration和Update-Database等命令。您不需要调用 Enable-Migrations,顺便说一句,AutomaticMigrationsEnabled
已过时。
关于c# - Enable-Migrations 已过时。使用 Add-Migration 开始使用迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64127543/