System.Collections.Generic.List`1[test.Node]

后端 未结 1 1847
闹比i
闹比i 2020-12-22 08:02

I have the following class named Node

 class Node
    {
        public int Id { get; set; }
        public int? ParentId { get; set; }
        public string         


        
相关标签:
1条回答
  • 2020-12-22 08:54

    Replace Children.ToString(); with:

    string.Join(",", Children.Select(x => x.Id));
    

    You are calling ToString on a IList<Node> so it's giving you the type name.If you want to see Ids of the child nodes you can use string.Join as shown above.

    0 讨论(0)
提交回复
热议问题