加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

实体框架 – 无法确定依赖操作的有效排序

发布时间:2020-12-14 00:49:17 所属栏目:百科 来源:网络整理
导读:这是我的模特儿 public string Content { get; set; }public Faq Reply { set; get; }public int? ReplyId { get; set; }public ICollectionFaq Children { get; set; }[ForeignKey("WriterId")]public virtual UserProfile Writer { get; set; }public virt
这是我的模特儿
public string Content { get; set; }

public Faq Reply { set; get; }

public int? ReplyId { get; set; }

public ICollection<Faq> Children { get; set; }

[ForeignKey("WriterId")]
public virtual UserProfile Writer { get; set; }

public virtual int? WriterId { get; set; }

public Status Status { get; set; }

[ForeignKey("DepartmentId")]
public virtual Department Department { get; set; }

public virtual int? DepartmentId { get; set; }

这是我的错误

Unable to determine a valid ordering for dependent operations. Dependencies may exist due to foreign key constraints,model requirements,or store-generated values.

看起来你有一个循环依赖.你收到保存数据的错误?

答案在这里:Clean way to deal with circular references in EF?

在这里:Entity Framework 4: inheritance and Associations

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读