Click or drag to resize
EnumerableEx.SelectMany<TSource, TOther> Method
Projects each element of a sequence to an given sequence and flattens the resulting sequences into one sequence.

Namespace: System.Linq
Assembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntax
C#
public static IEnumerable<TOther> SelectMany<TSource, TOther>(
	this IEnumerable<TSource> source,
	IEnumerable<TOther> other
)

Parameters

source
Type: System.Collections.Generic.IEnumerable<TSource>
A sequence of values to project.
other
Type: System.Collections.Generic.IEnumerable<TOther>
Inner sequence each source sequenec element is projected onto.

Type Parameters

TSource
First source sequence element type.
TOther
Second source sequence element type.

Return Value

Type: IEnumerable<TOther>
Sequence flattening the sequences that result from projecting elements in the source sequence.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<TSource>. 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).
See Also