Rediger

Del via


ImmutableArrayExtensions.SelectMany<TSource,TCollection,TResult> Method

Definition

Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.

public:
generic <typename TSource, typename TCollection, typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<TResult> ^ SelectMany(System::Collections::Immutable::ImmutableArray<TSource> immutableArray, Func<TSource, System::Collections::Generic::IEnumerable<TCollection> ^> ^ collectionSelector, Func<TSource, TCollection, TResult> ^ resultSelector);
public static System.Collections.Generic.IEnumerable<TResult> SelectMany<TSource,TCollection,TResult> (this System.Collections.Immutable.ImmutableArray<TSource> immutableArray, Func<TSource,System.Collections.Generic.IEnumerable<TCollection>> collectionSelector, Func<TSource,TCollection,TResult> resultSelector);
static member SelectMany : System.Collections.Immutable.ImmutableArray<'Source> * Func<'Source, seq<'Collection>> * Func<'Source, 'Collection, 'Result> -> seq<'Result>
<Extension()>
Public Function SelectMany(Of TSource, TCollection, TResult) (immutableArray As ImmutableArray(Of TSource), collectionSelector As Func(Of TSource, IEnumerable(Of TCollection)), resultSelector As Func(Of TSource, TCollection, TResult)) As IEnumerable(Of TResult)

Type Parameters

TSource

The type of the elements of immutableArray.

TCollection

The type of the intermediate elements collected by collectionSelector.

TResult

The type of the elements of the resulting sequence.

Parameters

immutableArray
ImmutableArray<TSource>

The immutable array.

collectionSelector
Func<TSource,IEnumerable<TCollection>>

A transform function to apply to each element of the input sequence.

resultSelector
Func<TSource,TCollection,TResult>

A transform function to apply to each element of the intermediate sequence.

Returns

IEnumerable<TResult>

An IEnumerable<T> whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of immutableArray and then mapping each of those sequence elements and their corresponding source element to a result element.

Applies to