Method ZipLongest
View SourceZipLongest<T1, T2, TResult>(IAsyncEnumerable<T1>, IAsyncEnumerable<T2>, Func<T1?, T2?, TResult>)
Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. The resulting sequence will always be as long as the longest of input sequences where the default value of each of the shorter sequence element types is used for padding.
Declaration
public static IAsyncEnumerable<TResult> ZipLongest<T1, T2, TResult>(this IAsyncEnumerable<T1> first, IAsyncEnumerable<T2> second, Func<T1?, T2?, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T1> | first | The first sequence of elements. |
IAsyncEnumerable<T2> | second | The second sequence of elements. |
Func<T1, T2, TResult> | resultSelector | A projection function that combines elements from all of the sequences. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of elements returned by |
Type Parameters
Name | Description |
---|---|
T1 | The type of the elements of |
T2 | The type of the elements of |
TResult | The type of the elements of the result sequence. |
Remarks
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ZipLongest<T1, T2>(IAsyncEnumerable<T1>, IAsyncEnumerable<T2>)
Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. The resulting sequence will always be as long as the longest of input sequences where the default value of each of the shorter sequence element types is used for padding.
Declaration
public static IAsyncEnumerable<(T1?, T2?)> ZipLongest<T1, T2>(this IAsyncEnumerable<T1> first, IAsyncEnumerable<T2> second)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T1> | first | The first sequence of elements. |
IAsyncEnumerable<T2> | second | The second sequence of elements. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(T1, T2)> | A sequence of (T1, T2) containing corresponding elements from each of the sequences. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the elements of |
T2 | The type of the elements of |
Remarks
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Any of the input sequences is null. |
ZipLongest<T1, T2, T3, TResult>(IAsyncEnumerable<T1>, IAsyncEnumerable<T2>, IAsyncEnumerable<T3>, Func<T1?, T2?, T3?, TResult>)
Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. The resulting sequence will always be as long as the longest of input sequences where the default value of each of the shorter sequence element types is used for padding.
Declaration
public static IAsyncEnumerable<TResult> ZipLongest<T1, T2, T3, TResult>(this IAsyncEnumerable<T1> first, IAsyncEnumerable<T2> second, IAsyncEnumerable<T3> third, Func<T1?, T2?, T3?, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T1> | first | The first sequence of elements. |
IAsyncEnumerable<T2> | second | The second sequence of elements. |
IAsyncEnumerable<T3> | third | The third sequence of elements. |
Func<T1, T2, T3, TResult> | resultSelector | A projection function that combines elements from all of the sequences. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of elements returned by |
Type Parameters
Name | Description |
---|---|
T1 | The type of the elements of |
T2 | The type of the elements of |
T3 | The type of the elements of |
TResult | The type of the elements of the result sequence. |
Remarks
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ZipLongest<T1, T2, T3>(IAsyncEnumerable<T1>, IAsyncEnumerable<T2>, IAsyncEnumerable<T3>)
Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. The resulting sequence will always be as long as the longest of input sequences where the default value of each of the shorter sequence element types is used for padding.
Declaration
public static IAsyncEnumerable<(T1?, T2?, T3?)> ZipLongest<T1, T2, T3>(this IAsyncEnumerable<T1> first, IAsyncEnumerable<T2> second, IAsyncEnumerable<T3> third)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T1> | first | The first sequence of elements. |
IAsyncEnumerable<T2> | second | The second sequence of elements. |
IAsyncEnumerable<T3> | third | The third sequence of elements. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(T1, T2, T3)> | A sequence of (T1, T2, T3) containing corresponding elements from each of the sequences. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the elements of |
T2 | The type of the elements of |
T3 | The type of the elements of |
Remarks
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Any of the input sequences is null. |
ZipLongest<T1, T2, T3, T4, TResult>(IAsyncEnumerable<T1>, IAsyncEnumerable<T2>, IAsyncEnumerable<T3>, IAsyncEnumerable<T4>, Func<T1?, T2?, T3?, T4?, TResult>)
Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. The resulting sequence will always be as long as the longest of input sequences where the default value of each of the shorter sequence element types is used for padding.
Declaration
public static IAsyncEnumerable<TResult> ZipLongest<T1, T2, T3, T4, TResult>(this IAsyncEnumerable<T1> first, IAsyncEnumerable<T2> second, IAsyncEnumerable<T3> third, IAsyncEnumerable<T4> fourth, Func<T1?, T2?, T3?, T4?, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T1> | first | The first sequence of elements. |
IAsyncEnumerable<T2> | second | The second sequence of elements. |
IAsyncEnumerable<T3> | third | The third sequence of elements. |
IAsyncEnumerable<T4> | fourth | The fourth sequence of elements. |
Func<T1, T2, T3, T4, TResult> | resultSelector | A projection function that combines elements from all of the sequences. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of elements returned by |
Type Parameters
Name | Description |
---|---|
T1 | The type of the elements of |
T2 | The type of the elements of |
T3 | The type of the elements of |
T4 | The type of the elements of |
TResult | The type of the elements of the result sequence. |
Remarks
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ZipLongest<T1, T2, T3, T4>(IAsyncEnumerable<T1>, IAsyncEnumerable<T2>, IAsyncEnumerable<T3>, IAsyncEnumerable<T4>)
Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. The resulting sequence will always be as long as the longest of input sequences where the default value of each of the shorter sequence element types is used for padding.
Declaration
public static IAsyncEnumerable<(T1?, T2?, T3?, T4?)> ZipLongest<T1, T2, T3, T4>(this IAsyncEnumerable<T1> first, IAsyncEnumerable<T2> second, IAsyncEnumerable<T3> third, IAsyncEnumerable<T4> fourth)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<T1> | first | The first sequence of elements. |
IAsyncEnumerable<T2> | second | The second sequence of elements. |
IAsyncEnumerable<T3> | third | The third sequence of elements. |
IAsyncEnumerable<T4> | fourth | The fourth sequence of elements. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<(T1, T2, T3, T4)> | A sequence of (T1, T2, T3, T4) containing corresponding elements from each of the sequences. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the elements of |
T2 | The type of the elements of |
T3 | The type of the elements of |
T4 | The type of the elements of |
Remarks
This method uses deferred execution and streams its results.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Any of the input sequences is null. |