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.4.0
public static IEnumerable<TResult> Cartesian<TFirst, TSecond, TResult>(
	this IEnumerable<TFirst> first,
	IEnumerable<TSecond> second,
	Func<TFirst, TSecond, TResult> resultSelector


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

Type Parameters

The type of the elements of first
The type of the elements of second
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