TreeOrdering.Sort<TItem,TIdentity> method

namespace: Serenity.Services   assemblySerenity.Net.Services

Applies tree based ordering to the items

public static List<TItem> Sort<TItem, TIdentity>(IEnumerable<TItem> items, 
    Func<TItem, TIdentity> getId, Func<TItem, TIdentity?> getParentId)
    where TIdentity : struct
parameter description
TItem Type of items
TIdentity Type of ID fields of the items
items List of items
getId Callback to get ID for an item
getParentId Callback to get parent ID for an item

See Also