Click or drag to resize
MoreEnumerableCartesianTFirst, TSecond, TResult Method
Returns the Cartesian product of two sequences by combining each element of the first set with each in the second and applying the user=define projection to the pair.

Namespace:  MoreLinq
Assembly:  MoreLinq (in MoreLinq.dll) Version: 2.2.0
Syntax
public static IEnumerable<TResult> Cartesian<TFirst, TSecond, TResult>(
	this IEnumerable<TFirst> first,
	IEnumerable<TSecond> second,
	Func<TFirst, TSecond, TResult> resultSelector
)

Parameters

first
Type: System.Collections.GenericIEnumerableTFirst
The first sequence of elements
second
Type: System.Collections.GenericIEnumerableTSecond
The second sequence of elements
resultSelector
Type: SystemFuncTFirst, TSecond, TResult
A projection function that combines elements from both sequences

Type Parameters

TFirst
The type of the elements of first
TSecond
The type of the elements of second
TResult
The type of the elements of the result sequence

Return Value

Type: IEnumerableTResult
A sequence representing the Cartesian product of the two source sequences

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTFirst. 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