您的位置:首页 > 产品设计 > UI/UE

MVC中数据库表如果是一对一的主键关系时要加[Required]不然会出错Unable to determine the principal end of an association between the types

2013-03-19 12:06 429 查看

Unable to determine the principal end of an association between the types '***. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.

[Required]
public virtual User User { get; set; }


解决的是如下情况:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐