Redigera

Dela via


ParallelEnumerable.Zip Method

Definition

Merges in parallel two sequences by using the specified predicate function.

Overloads

Zip<TFirst,TSecond,TResult>(ParallelQuery<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)
Obsolete.

This Zip overload should never be called. This method is marked as obsolete and always throws NotSupportedException when invoked.

Zip<TFirst,TSecond,TResult>(ParallelQuery<TFirst>, ParallelQuery<TSecond>, Func<TFirst,TSecond,TResult>)

Merges in parallel two sequences by using the specified predicate function.

Zip<TFirst,TSecond,TResult>(ParallelQuery<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Caution

The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.

This Zip overload should never be called. This method is marked as obsolete and always throws NotSupportedException when invoked.

public:
generic <typename TFirst, typename TSecond, typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TResult> ^ Zip(System::Linq::ParallelQuery<TFirst> ^ first, System::Collections::Generic::IEnumerable<TSecond> ^ second, Func<TFirst, TSecond, TResult> ^ resultSelector);
[System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
public static System.Linq.ParallelQuery<TResult> Zip<TFirst,TSecond,TResult> (this System.Linq.ParallelQuery<TFirst> first, System.Collections.Generic.IEnumerable<TSecond> second, Func<TFirst,TSecond,TResult> resultSelector);
[<System.Obsolete("The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")>]
static member Zip : System.Linq.ParallelQuery<'First> * seq<'Second> * Func<'First, 'Second, 'Result> -> System.Linq.ParallelQuery<'Result>
<Extension()>
Public Function Zip(Of TFirst, TSecond, TResult) (first As ParallelQuery(Of TFirst), second As IEnumerable(Of TSecond), resultSelector As Func(Of TFirst, TSecond, TResult)) As ParallelQuery(Of TResult)

Type Parameters

TFirst

This type parameter is not used.

TSecond

This type parameter is not used.

TResult

This type parameter is not used.

Parameters

first
ParallelQuery<TFirst>

This parameter is not used.

second
IEnumerable<TSecond>

This parameter is not used.

resultSelector
Func<TFirst,TSecond,TResult>

This parameter is not used.

Returns

ParallelQuery<TResult>

This overload always throws a NotSupportedException.

Attributes

Exceptions

The exception that occurs when this method is called.

Remarks

This overload exists to disallow usage of Zip with a left data source of type ParallelQuery<TSource> and a right data source of type IEnumerable<T>. Otherwise, the Zip operator would appear to be bind to the parallel implementation, but would in reality bind to the sequential implementation.

See also

Applies to

Zip<TFirst,TSecond,TResult>(ParallelQuery<TFirst>, ParallelQuery<TSecond>, Func<TFirst,TSecond,TResult>)

Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs
Source:
ParallelEnumerable.cs

Merges in parallel two sequences by using the specified predicate function.

public:
generic <typename TFirst, typename TSecond, typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TResult> ^ Zip(System::Linq::ParallelQuery<TFirst> ^ first, System::Linq::ParallelQuery<TSecond> ^ second, Func<TFirst, TSecond, TResult> ^ resultSelector);
public static System.Linq.ParallelQuery<TResult> Zip<TFirst,TSecond,TResult> (this System.Linq.ParallelQuery<TFirst> first, System.Linq.ParallelQuery<TSecond> second, Func<TFirst,TSecond,TResult> resultSelector);
static member Zip : System.Linq.ParallelQuery<'First> * System.Linq.ParallelQuery<'Second> * Func<'First, 'Second, 'Result> -> System.Linq.ParallelQuery<'Result>
<Extension()>
Public Function Zip(Of TFirst, TSecond, TResult) (first As ParallelQuery(Of TFirst), second As ParallelQuery(Of TSecond), resultSelector As Func(Of TFirst, TSecond, TResult)) As ParallelQuery(Of TResult)

Type Parameters

TFirst

The type of the elements of the first sequence.

TSecond

The type of the elements of the second sequence.

TResult

The type of the return elements.

Parameters

first
ParallelQuery<TFirst>

The first sequence to zip.

second
ParallelQuery<TSecond>

The second sequence to zip.

resultSelector
Func<TFirst,TSecond,TResult>

A function to create a result element from two matching elements.

Returns

ParallelQuery<TResult>

A sequence that has elements of type TResult that are obtained by performing resultSelector pairwise on two sequences. If the sequence lengths are unequal, this truncates to the length of the shorter sequence.

Exceptions

first or second or resultSelector is a null reference (Nothing in Visual Basic).

One or more exceptions occurred during the evaluation of the query.

Applies to