【发布时间】:2022-12-27 20:48:05
【问题描述】:
how to find any item from the list as it is dynamic, it may be in the parent or child in any position of list and need to stop finding when the list of child count will be 0, below is the Model of the list and and example of Hierarchical Parent-Child Structure
example:-
Parent->child->child->child or parent->child->child->child->child->child->child
public class Child
{
public string key { get; set; }
public string title { get; set; }
public string parent_Category { get; set; }
public List<Child> children { get; set; }
}
public class Parent
{
public string key { get; set; }
public string title { get; set; }
public string parent_Category { get; set; }
public List<Child> children { get; set; }
}
【问题讨论】:
-
why do you have different classes
ParentandChild? -
@viveknuna because data is coming like that only and i have to manage with this classes
-
class Child: Parentis this valid in your case?
标签: c# .net linq xamarin c#-4.0