C# 实体框架fluent api自身关系与表C相同#
我有一个关于简单课中关系的问题。它的类类似于二叉树:C# 实体框架fluent api自身关系与表C相同#,c#,entity-framework,relation,C#,Entity Framework,Relation,我有一个关于简单课中关系的问题。它的类类似于二叉树: class Tree { public int Id { get; set; } public virtual Tree LeftChild { get; set; } public virtual Tree RightChild { get; set; } } 这必须是0..1到0..1的关系-两次(左子树和右子树) 如何在fluent API中执行此操作
class Tree
{
public int Id { get; set; }
public virtual Tree LeftChild { get; set; }
public virtual Tree RightChild { get; set; }
}
这必须是0..1到0..1的关系-两次(左子树和右子树)
如何在fluent API中执行此操作