如何解决vs 2019 社区版中 .net core 5.0 的 .net core ef 迁移难题?
- 内容介绍
- 文章标签
- 相关推荐
本文共计458个文字,预计阅读时间需要2分钟。
问题一:执行Add-Migration时出现的问题内容:当执行Add-Migration时,遇到模型类主键标识问题。通常都是模型类缺少主键标识问题,增加KEY即可解决。错误信息:The entity type 'xxxx' requires a primary key to be defined. If you intended to use a keyless entity type, call 'Ha'
解决方法:确保模型类中定义了主键。如果未定义,添加主键即可。
本文共计458个文字,预计阅读时间需要2分钟。
问题一:执行Add-Migration时出现的问题内容:当执行Add-Migration时,遇到模型类主键标识问题。通常都是模型类缺少主键标识问题,增加KEY即可解决。错误信息:The entity type 'xxxx' requires a primary key to be defined. If you intended to use a keyless entity type, call 'Ha'
解决方法:确保模型类中定义了主键。如果未定义,添加主键即可。

