SelectMany(TSource, TResult) Method (ParallelQuery(TSource), Func(TSource, IEnumerable(TResult)))

Task Parallel System.Threading

Projects in parallel each element of a sequence to an IEnumerable{T} and flattens the resulting sequences into one sequence.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function SelectMany(Of TSource, TResult) ( _
	source As ParallelQuery(Of TSource), _
	selector As Func(Of TSource, IEnumerable(Of TResult)) _
) As ParallelQuery(Of TResult)
C#
public static ParallelQuery<TResult> SelectMany<TSource, TResult>(
	ParallelQuery<TSource> source,
	Func<TSource, IEnumerable<TResult>> selector
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A sequence of values to project.
selector
Type: System..::.Func<(Of <(TSource, IEnumerable<(Of <(TResult>)>)>)>)
A transform function to apply to each element.

Type Parameters

TSource
The type of elements of source.
TResult
The type of the elements of the sequence returned by selector.

Return Value

A sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source or selector is a null reference (Nothing in Visual Basic).

See Also