public static IEnumerable <TResult> Siblings <TResult>(this IEnumerable <TResult> startNodes, Func <TResult, TResult> parentSelector, Func <TResult, IEnumerable <TResult> > childSelector, bool includeSelf = false) { return(startNodes.SelectMany(startNode => HierarchyWalker.Siblings(startNode, parentSelector, childSelector, includeSelf))); }
public static IEnumerable <TResult> Descendants <TResult>(this IEnumerable <TResult> startNodes, Func <TResult, IEnumerable <TResult> > childSelector, bool includeSelf = false) { return(startNodes.SelectMany(startNode => HierarchyWalker.Descendants(startNode, childSelector, includeSelf))); }