Sequence SelectMany TSource, TCollection, TResult  Method (ISequence TSource , Func TSource, IEnumerable TCollection  , Func TSource, TCollection, TResult )A Sandcastle Documented Class Library
Projects each element of a sequence to an IEnumerable T , flattens the resulting enumerables into one sequence, and invokes a result selector function on each element therein.

Namespace: Sequences
Assembly: Sequences (in Sequences.dll) Version: 1.0.1.0 (1.0.1)
Syntax
public static ISequence<TResult> SelectMany<TSource, TCollection, TResult>(
	this ISequence<TSource> source,
	Func<TSource, IEnumerable<TCollection>> collectionSelector,
	Func<TSource, TCollection, TResult> resultSelector
)

Parameters

source
Type: Sequences ISequence TSource 
A sequence of values to project.
collectionSelector
Type: System Func TSource, IEnumerable TCollection  
A transform function to apply to each element of the input sequence.
resultSelector
Type: System Func TSource, TCollection, TResult 
A transform function to apply to each element of the intermediate sequence.
Type Parameters
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 sequence.

Return Value

Type: ISequence TResult 
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.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ISequence TSource . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also