【发布时间】:2020-06-23 01:03:44
【问题描述】:
我正在使用 Entity Framework 中的 update-database 命令更新我的数据库,并引发错误消息:String or binary data would be truncated. The statement has been terminated
如何让更新生效?
【问题讨论】:
-
您需要为此类添加属性的源代码 - 猜测一下,您没有正确注释属性。
-
如果您想使用 C# 捕获违规字段,请查看此答案:stackoverflow.com/a/71341426/8644294
标签: entity-framework ef-code-first