Beispiel #1
0
 public static IEnumerable <TResult> Ancestors <TResult>(this IEnumerable <TResult> startNodes,
                                                         Func <TResult, TResult> parentSelector, bool includeSelf = false)
 {
     return(startNodes.SelectMany(startNode => HierarchyWalker.Ancestors(startNode, parentSelector, includeSelf)));
 }
Beispiel #2
0
 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)));
 }