IEnumerable.selectMany Method

Projects each element of this sequence to an enumerable, 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.
 

Parameters

collectionSelector

Type: Function
A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
resultSelector

Type: Function
A transform function to apply to each element of the intermediate sequence.
Optional: True

Return Value


Type: IEnumerable
An enumerable 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.