public class DialogueEntry
{
[Key]
public int Id { get; set; }
[ForeignKey("Take")]
public int? MasterTakeId { get; set; }
public Take MasterTake { get; set; }
public ICollection<Take> Takes { get; set; }
}
public class Take
{
[Key]
public int Id { get; set; }
[ForeignKey("DialogueEntry")]
public int DialogueEntryId { get; set; }
public DialogueEntry DialogueEntry { get; set; }
}
我收到以下错误:
无法确定导航“DialogueEntry”所表示的关系。“Take”类型的MasterTake。手动配置关系,或者使用“[NotMapped]”特性或使用“EntityTypeBuilder”忽略此属性。忽略“OnModelCreating”中的“”。
我正在尝试配置之间的一对多关系
DialogueEntry
和
Take
.
对话框条目
具有对的一对一引用
拿
表是
MasterTake
属性,如果不添加一对多导航行,则一切正常。
当我添加
ICollection
属性,我会显示错误消息。