public static IEnumerable<TResult> Cartesian<T1, T2, T3, T4, T5, T6, T7, TResult>(
this IEnumerable<T1> first,
IEnumerable<T2> second,
IEnumerable<T3> third,
IEnumerable<T4> fourth,
IEnumerable<T5> fifth,
IEnumerable<T6> sixth,
IEnumerable<T7> seventh,
Func<T1, T2, T3, T4, T5, T6, T7, TResult> resultSelector
)
<ExtensionAttribute>
Public Shared Function Cartesian(Of T1, T2, T3, T4, T5, T6, T7, TResult) (
first As IEnumerable(Of T1),
second As IEnumerable(Of T2),
third As IEnumerable(Of T3),
fourth As IEnumerable(Of T4),
fifth As IEnumerable(Of T5),
sixth As IEnumerable(Of T6),
seventh As IEnumerable(Of T7),
resultSelector As Func(Of T1, T2, T3, T4, T5, T6, T7, TResult)
) As IEnumerable(Of TResult)
public:
[ExtensionAttribute]
generic<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename TResult>
static IEnumerable<TResult>^ Cartesian(
IEnumerable<T1>^ first,
IEnumerable<T2>^ second,
IEnumerable<T3>^ third,
IEnumerable<T4>^ fourth,
IEnumerable<T5>^ fifth,
IEnumerable<T6>^ sixth,
IEnumerable<T7>^ seventh,
Func<T1, T2, T3, T4, T5, T6, T7, TResult>^ resultSelector
)
[<ExtensionAttribute>]
static member Cartesian :
first : IEnumerable<'T1> *
second : IEnumerable<'T2> *
third : IEnumerable<'T3> *
fourth : IEnumerable<'T4> *
fifth : IEnumerable<'T5> *
sixth : IEnumerable<'T6> *
seventh : IEnumerable<'T7> *
resultSelector : Func<'T1, 'T2, 'T3, 'T4, 'T5, 'T6, 'T7, 'TResult> -> IEnumerable<'TResult>
The method returns items in the same order as a nested foreach loop, but all sequences except for first are cached when iterated over. The cache is then re-used for any subsequent iterations.
This method uses deferred execution and stream its results.