对于一般的目录树,通常就是一对多的自反关系,一般会有一个PID,引用于这个ID,实体类代码类似于下:

class Catalog
{
    public Catalog()
    {
        this.References = new List<Reference>();
        this.Children = new List<Catalog>();
    }
 
    public string CatalogID { get; set; }
    public string CatalogName { get; set; }
    public string CatalogPID { get; set; }
    public ICollection<Reference> References { get; set; }
 
    public virtual Catalog Parent { get; set; }
    public virtual ICollection<Catalog> Children { get; set; }
}

相关文章:

  • 2021-09-20
  • 2021-08-26
  • 2021-09-28
  • 2022-12-23
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2022-02-16
  • 2022-12-23
相关资源
相似解决方案