M_CSharpx_EnumerableExtensions_Cartesian__3 - adutton/commandline GitHub Wiki
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: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
public static IEnumerable<TResult> Cartesian<TFirst, TSecond, TResult>(
this IEnumerable<TFirst> first,
IEnumerable<TSecond> second,
Func<TFirst, TSecond, TResult> resultSelector
)VB
<ExtensionAttribute>
Public Shared Function Cartesian(Of TFirst, TSecond, TResult) (
first As IEnumerable(Of TFirst),
second As IEnumerable(Of TSecond),
resultSelector As Func(Of TFirst, TSecond, TResult)
) As IEnumerable(Of TResult)C++
public:
[ExtensionAttribute]
generic<typename TFirst, typename TSecond, typename TResult>
static IEnumerable<TResult>^ Cartesian(
IEnumerable<TFirst>^ first,
IEnumerable<TSecond>^ second,
Func<TFirst, TSecond, TResult>^ resultSelector
)F#
[<ExtensionAttribute>]
static member Cartesian :
first : IEnumerable<'TFirst> *
second : IEnumerable<'TSecond> *
resultSelector : Func<'TFirst, 'TSecond, 'TResult> -> IEnumerable<'TResult>
- first
- Type: System.Collections.Generic.IEnumerable(TFirst)
- second
- Type: System.Collections.Generic.IEnumerable(TSecond)
- resultSelector
- Type: System.Func(TFirst, TSecond, TResult)
- TFirst
- TSecond
- TResult
Type: IEnumerable(TResult)
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(TFirst). 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).