C# 树形结构tree拼接

时间:2020-09-18 17:22:48   收藏:0   阅读:68

实体类:

public class Project
{
    public Project()
    {
        children = new List<Project>();
    }
    public int id { get; set; }
    public int parentId { get; set; }
    public string name { get; set; }
    public List<Project> children { get; set; }
}
idparentIdname
1 -1 name1
2 1 name2
3 1 name3
4 2 name4
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!