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

來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
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

屬性

例外狀況

當呼叫這個方法時所發生的例外狀況。

備註

此多載存在,不允許使用具有 類型 ParallelQuery<TSource> 左側數據源的 Zip,以及類型的 IEnumerable<T>右數據源。 否則,Zip 運算符似乎系結至平行實作,但實際上會系結至循序實作。

另請參閱

適用於

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

來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
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)。

評估查詢的期間發生一或多個例外狀況。

適用於