EF生成迁移脚本报错:Entity type '' has a split mapping, but it doesn't map any non-primary key property to the main store object. Keep at least one non-primary key property mapped to a column on '.


EFCore生成迁移脚本时,发生如下错误:

Entity type 'tb_Project' has a split mapping, but it doesn't map any non-primary key property to the main store object. Keep at least one non-primary key property mapped to a column on 'tb_Project'.

原因

采用了分表的方式,但模型中只有两个健,一个主键,一个描述,没有其他多余的字段了,这个时候把描述列分表的话,就会报这个错误

解决

添加一个不用于分表的非主键的列,就解决这个问题了

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
上一篇:C#获得类型Type实现的的接口列表,支持排除基类实现的接口
下一篇:C# Roslyn编译csproj项目 使用Roslyn编译整个C#项目
评论列表

发表评论

评论内容
昵称:
关联文章

EF生成迁移本报Entity type '' has a split mapping, but it doesn't map any non-primary key property to the main store object. Keep at least one non-primary key property mapped to a column on '.
.Net启动程序报It was not possible to find any compatible framework version
.net Core Swagger报 the same schemaid is already used for type swagger
Linq to SQL语句基础讲解
WCF中常见的报The content type text
.NET Core 运行时T4模板使用,T4生成代码
Solution for "A Graphics Object cannot be Created from an Image that has an Indexed Pixel Format"
sql server系统表详细说明 之 sys.column_store_segments
Roslyn+T4+EnvDTE项目完全自动化(3) ——生成c++代码
Access to the path 'C:\Windows\TEMP\xxx.tmp' is denied.
sql server系统表详细说明 之 sys.column_store_dictionaries
TinyMCE
sql server系统表详细说明 之 sys.columns
sql server系统表详细说明 之 sys.column_store_row_groups
如何关掉has been registered with the fake serial number> 弹窗
EF 分页 SQL2008 报 Featch Next
网站迁移纪实:从Web Form 到 Asp.Net Core (Abp vNext 自定义开发)
sql server系统表详细说明 之 sys.all_objects
sql server系统表详细说明 之 sys.system_objects
EF 值转换

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码