The C# code that uses Linq find all child nodes of one node in hierarchical data.
public IEnumerableFindChilds(List items, int toplevelid) { List inner = new List (); foreach (var t in items.Where(item => item.ParentId == toplevelid)) { inner.Add(t); inner = inner.Union(FindChilds(items, t.Id)).ToList(); } return inner; }