-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Collections_EnumerableExtensions_Flatten__1
Andrew Koryavchenko edited this page Jun 17, 2018
·
7 revisions
Returns a flattened sequence from a graph or hierarchy of elements by using the specified children selector.
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static IEnumerable<T> Flatten<T>(
this IEnumerable<T> source,
Func<T, IEnumerable<T>> childrenSelector
)
VB
<ExtensionAttribute>
Public Shared Function Flatten(Of T) (
source As IEnumerable(Of T),
childrenSelector As Func(Of T, IEnumerable(Of T))
) As IEnumerable(Of T)
F#
[<ExtensionAttribute>]
static member Flatten :
source : IEnumerable<'T> *
childrenSelector : Func<'T, IEnumerable<'T>> -> IEnumerable<'T>
- source
- Type: System.Collections.Generic.IEnumerable(T)
The source hierarchy to flatten. - childrenSelector
- Type: System.Func(T, IEnumerable(T))
A function used to retrieve the children of an element.
- T
- [Missing documentation for "M:CodeJam.Collections.EnumerableExtensions.Flatten
1(System.Collections.Generic.IEnumerable{
0},System.Func{0,System.Collections.Generic.IEnumerable{
0}})"]
Type: IEnumerable(T)
A flat sequence of elements produced from the elements in the source hierarchy.
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(T). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).