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

一个序列,具有通过对两个序列执行resultSelector成对获取的类型TResult元素的序列。 如果序列长度不相等,则此长度将截断为较短序列的长度。

例外

firstsecondresultSelector 是空引用(Visual Basic 中没有任何内容)。

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

适用于