SelectRecursive<T>(T, Func<T, T?>)
Selects a sequence by recursively applying a function to get the next item, starting from a single initial item.
Declaration
public static IEnumerable<T> SelectRecursive<T>(T item, Func<T, T?> getNext) where T : class, ICompilationElementParameters
| Type | Name | Description |
|---|---|---|
| T | item | The initial item. |
| Func<T, T> | getNext | A function that returns the next item in the sequence, or |
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | An enumerable sequence starting with |
Type Parameters
| Name | Description |
|---|---|
| T | The type of compilation element. |
SelectRecursive<T>(IEnumerable<T>, Func<T, T?>)
Selects a sequence by recursively applying a function to get the next item, for each item in a collection.
Declaration
public static IEnumerable<T> SelectRecursive<T>(this IEnumerable<T> items, Func<T, T?> getNext) where T : class, ICompilationElementParameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | items | The initial collection of items. |
| Func<T, T> | getNext | A function that returns the next item in the sequence, or |
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | An enumerable sequence containing all items and their descendants obtained by recursively applying |
Type Parameters
| Name | Description |
|---|---|
| T | The type of compilation element. |