-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Collections_EnumerableExtensions_Flatten__1
andrewvk edited this page Apr 5, 2016
·
7 revisions
[This is preliminary documentation and is subject to change.]
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: 1.0.0.0 (1.0.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
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).