語言

ParallelEnumerable.Count 方法

定義

傳回平行序列中的項目數目。

多載

名稱 Description
Count<TSource>(ParallelQuery<TSource>)

傳回平行序列中的項目數目。

Count<TSource>(ParallelQuery<TSource>, Func<TSource,Boolean>)

傳回數位,代表指定平行序列中滿足條件的項目數目。

Count<TSource>(ParallelQuery<TSource>)

來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs

傳回平行序列中的項目數目。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static int Count(System::Linq::ParallelQuery<TSource> ^ source);
public static int Count<TSource>(this System.Linq.ParallelQuery<TSource> source);
static member Count : System.Linq.ParallelQuery<'Source> -> int
<Extension()>
Public Function Count(Of TSource) (source As ParallelQuery(Of TSource)) As Integer

類型參數

TSource

元素 source的類型。

參數

source
ParallelQuery<TSource>

包含待計數元素的序列。

傳回

輸入序列中的元素數量。

例外狀況

source 是空參考(Visual Basic 中無任何參考)。

原始碼中的元素數量比 Int32.MaxValue 還多。 (此處的 InnerException 為 OverflowException)-或- 在查詢評估過程中發生了一個或多個例外。

另請參閱

適用於

Count<TSource>(ParallelQuery<TSource>, Func<TSource,Boolean>)

來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs
來源:
ParallelEnumerable.cs

傳回數位,代表指定平行序列中滿足條件的項目數目。

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static int Count(System::Linq::ParallelQuery<TSource> ^ source, Func<TSource, bool> ^ predicate);
public static int Count<TSource>(this System.Linq.ParallelQuery<TSource> source, Func<TSource,bool> predicate);
static member Count : System.Linq.ParallelQuery<'Source> * Func<'Source, bool> -> int
<Extension()>
Public Function Count(Of TSource) (source As ParallelQuery(Of TSource), predicate As Func(Of TSource, Boolean)) As Integer

類型參數

TSource

元素 source的類型。

參數

source
ParallelQuery<TSource>

包含待計數元素的序列。

predicate
Func<TSource,Boolean>

一個用來測試每個元素條件的函數。

傳回

一個數字,代表序列中有多少元素滿足謂詞函數的條件。

例外狀況

source 或 predicate 是空參考(Nothing in Visual Basic)。

原始碼中的元素數量比 Int32.MaxValue 還多。 (此處的 InnerException 為 OverflowException)-或- 在查詢評估過程中發生了一個或多個例外。

另請參閱

適用於