TEnumerable.SelectMany<T,TCollection,TResult> Method
Overloads
| SelectMany<T,TResult>(IEnumerable<T>, Func<T,IEnumerable<TResult>>) |
Projects each element of a sequence to an IEnumerable<T> and flattens the resulting sequences into one sequence. |
| SelectMany<T,TResult>(IEnumerable<T>, Func<T,Integer,IEnumerable<TResult>>) |
Projects each element of a sequence to an IEnumerable<T> , and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. |
| SelectMany<T,TCollection,TResult>(IEnumerable<T>, Func<T,IEnumerable<TCollection>>, Func<T,TCollection,TResult>) |
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. |
| SelectMany<T,TCollection,TResult>(IEnumerable<T>, Func<T,Integer,IEnumerable<TCollection>>, Func<T,TCollection,TResult>) |
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. The index of each source element is used in the intermediate projected form of that element. |
Projects each element of a sequence to an IEnumerable<T> and flattens the resulting sequences into one sequence.
class function SelectMany<T,TResult>(const source: IEnumerable<T>; const selector: Func<T, IEnumerable<TResult>>): IEnumerable<TResult>
Type Parameters
- T
The type of the elements of source .
- TResult
The type of the elements of the sequence returned by selector .
Parameters
- source
- IEnumerable<T>
A sequence of values to project.
- selector
- Func<T, IEnumerable<TResult>>
A transform function to apply to each element.
Returns
A sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
Exceptions
source or selector is nil .
Projects each element of a sequence to an IEnumerable<T> , and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element.
class function SelectMany<T,TResult>(const source: IEnumerable<T>; const selector: Func<T, Integer, IEnumerable<TResult>>): IEnumerable<TResult>
Type Parameters
- T
The type of the elements of source .
- TResult
The type of the elements of the sequence returned by selector .
Parameters
- source
- IEnumerable<T>
A sequence of values to project.
- selector
- Func<T, Integer, IEnumerable<TResult>>
A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
Returns
A sequence whose elements are the result of invoking the one-to-many transform function on each element of an input sequence.
Exceptions
source or selector is nil .
SelectMany<T,TCollection,TResult>(IEnumerable<T>, Func<T,IEnumerable<TCollection>>, Func<T,TCollection,TResult>)
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.
class function SelectMany<T,TCollection,TResult>(const source: IEnumerable<T>; const collectionSelector: Func<T, IEnumerable<TCollection>>; const resultSelector: Func<T, TCollection, TResult>): IEnumerable<TResult>
Type Parameters
- T
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 sequence.
Parameters
- source
- IEnumerable<T>
A sequence of values to project.
- collectionSelector
- Func<T, IEnumerable<TCollection>>
A transform function to apply to each element of the input sequence.
- resultSelector
- Func<T, TCollection, TResult>
A transform function to apply to each element of the intermediate sequence.
Returns
A sequence 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.
Exceptions
source or collectionSelector or resultSelector
is nil .
SelectMany<T,TCollection,TResult>(IEnumerable<T>, Func<T,Integer,IEnumerable<TCollection>>, Func<T,TCollection,TResult>)
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. The index of each source element is used in the intermediate projected form of that element.
class function SelectMany<T,TCollection,TResult>(const source: IEnumerable<T>; const collectionSelector: Func<T, Integer, IEnumerable<TCollection>>; const resultSelector: Func<T, TCollection, TResult>): IEnumerable<TResult>
Type Parameters
- T
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 sequence.
Parameters
- source
- IEnumerable<T>
A sequence of values to project.
- collectionSelector
- Func<T, Integer, IEnumerable<TCollection>>
A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
- resultSelector
- Func<T, TCollection, TResult>
A transform function to apply to each element of the intermediate sequence.
Returns
A sequence 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.
Exceptions
source or collectionSelector or resultSelector
is nil .