ParallelEnumerable.Zip 方法

定义

通过使用指定的谓词函数并行合并两个序列。

重载

Zip<TFirst,TSecond,TResult>(ParallelQuery<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)
已过时.

切勿调用此 Zip 重载。 此方法已标记为过时,调用此方法时总是会引发 NotSupportedException

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

通过使用指定的谓词函数并行合并两个序列。

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

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

注意

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>.

切勿调用此 Zip 重载。 此方法已标记为过时,调用此方法时总是会引发 NotSupportedException

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)

类型参数

TFirst

未使用此类型参数。

TSecond

未使用此类型参数。

TResult

未使用此类型参数。

参数

first
ParallelQuery<TFirst>

未使用此参数。

second
IEnumerable<TSecond>

未使用此参数。

resultSelector
Func<TFirst,TSecond,TResult>

未使用此参数。

返回

ParallelQuery<TResult>

此重载总是会引发 NotSupportedException

属性

例外

调用此方法时发生的异常。

注解

存在此重载是为了禁止将 Zip 与 类型的 ParallelQuery<TSource> 左数据源和类型的 IEnumerable<T>右数据源一起使用。 否则,Zip 运算符似乎绑定到并行实现,但实际上会绑定到顺序实现。

另请参阅

适用于

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

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

通过使用指定的谓词函数并行合并两个序列。

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)

类型参数

TFirst

第一个序列中的元素的类型。

TSecond

第二个序列中的元素的类型。

TResult

返回元素的类型。

参数

first
ParallelQuery<TFirst>

要压缩的第一个序列。

second
ParallelQuery<TSecond>

要压缩的第二个序列。

resultSelector
Func<TFirst,TSecond,TResult>

用于从两个匹配元素创建结果元素的函数。

返回

ParallelQuery<TResult>

一个序列,其中包含通过对两个序列执行 TResult 配对获得的 resultSelector 类型的元素。 如果序列长度不相等,这将截断为较短序列的长度。

例外

firstsecondresultSelector 是 null 引用(在 Visual Basic 中为 Nothing)。

评估查询期间发生一个或多个异常。

适用于