.net 常规错误异常支持 newvalidContext 上下文的模型

.net regular error exception The model backing the newvalidContext context

我在 C# 中工作,在更改正则表达式等模型后遇到问题。

我收到以下错误:

支持 'newvalidContext' 上下文的模型自 数据库已创建。考虑使用代码优先迁移来更新 数据库 (go.microsoft.com/fwlink/?LinkId=238269).

如果您更改模型中的某些内容,则必须迁移它,以便更改也适用于数据库。 "first you drop and delete your old migration"

那么您需要输入:

dotnet ef 迁移添加 init1

然后:

dotnet ef 数据库更新