[]
        
(Showing Draft Content)

C1.LiveLinq.IndexedQueryExtensions.SelectMany

SelectMany Method

SelectMany<TSource, TCollection, TResult>(IIndexedSource<TSource>, Expression<Func<TSource, IEnumerable<TCollection>>>, Expression<Func<TSource, TCollection, TResult>>)

Projects each element of a collection to a sequence of collections, flattens the resulting collections into one collection, and invokes a result selector function on each element therein.

Declaration
public static IIndexedSource<TResult> SelectMany<TSource, TCollection, TResult>(this IIndexedSource<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
Parameters
Type Name Description
IIndexedSource<TSource> source

A collection of values to project.

Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector

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

Expression<Func<TSource, TCollection, TResult>> resultSelector

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

Returns
Type Description
IIndexedSource<TResult>

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

Type Parameters
Name Description
TSource

The type of the elements of source.

TCollection

The type of the intermediate elements collected by collectionSelector.

TResult

The type of the elements of the resulting collection.

SelectMany<TSource, TResult>(IIndexedSource<TSource>, Expression<Func<TSource, IEnumerable<TResult>>>)

Projects each element of a collection to a sequence of collections and flattens the resulting collections into one collection.

Declaration
public static IIndexedSource<TResult> SelectMany<TSource, TResult>(this IIndexedSource<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector)
Parameters
Type Name Description
IIndexedSource<TSource> source

A collection of values to project.

Expression<Func<TSource, IEnumerable<TResult>>> selector

A transform function to apply to each element.

Returns
Type Description
IIndexedSource<TResult>

An IIndexedSource<TResult> whose elements are the result of invoking the one-to-many transform function on each element of the source collection.

Type Parameters
Name Description
TSource

The type of the elements of source.

TResult

The type of the elements of the sequence returned by selector.