Method SelectManyRecursive
SelectManyRecursive<T>(IEnumerable<T>, Func<T, IEnumerable<T>>, Boolean)
Selects the closure of a graph. This is typically used to select all descendants of a tree node. This method returns distinct nodes only.
Declaration
public static IReadOnlyCollection<T> SelectManyRecursive<T>(this IEnumerable<T> collection, Func<T, IEnumerable<T>> getItems, bool deduplicate = false)
where T : class, ICompilationElement
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | collection | The initial collection of items. |
Func<T, IEnumerable<T>> | getItems | A function that returns the set of all nodes connected to a given node. |
Boolean | deduplicate |
|
Returns
Type | Description |
---|---|
IReadOnlyCollection<T> |
Type Parameters
Name | Description |
---|---|
T |