HierarchyExtensions
public static HierarchyCollection<T> AsHierarchy<T, TProperty>(this IEnumerable<T> allItems, Func<T, TProperty> idProperty, Func<T, TProperty> parentIdProperty)
Turns a flat list of items into a hierarchical data structure. The root
levels will be any object that have no value set for parentIdProperty.
public static HierarchyNode<T> AsHierarchy<T, TProperty>(this IEnumerable<T> allItems, T parent) where T : IHierarchical<TProperty>
public static HierarchyNode<T> AsHierarchy<T, TProperty>(this IEnumerable<T> allItems, T parent, Func<T, TProperty> idProperty, Func<T, TProperty> parentIdProperty)
Returns a hierarchical data structure with the parent item as the root.
public static HierarchyCollection<T> AsHierarchy<T>(this IEnumerable<T> allItems) where T : INestedSet
public static IEnumerable<T> ToNestedList<T, TProperty>(this IEnumerable<T> allItems, Func<T, TProperty> idProperty, Func<T, TProperty> parentIdProperty, Func<T, TProperty> childProperty) where T : IEnumerable<TProperty>