ParallelEnumerable.Where 方法

定义

基于谓词并行筛选值序列。Filters in parallel a sequence of values based on a predicate.

重载

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

基于谓词并行筛选值序列。Filters in parallel a sequence of values based on a predicate.

Where<TSource>(ParallelQuery<TSource>, Func<TSource,Int32,Boolean>)

基于谓词并行筛选值序列。Filters in parallel a sequence of values based on a predicate. 将在谓词函数的逻辑中使用每个元素的索引。Each element's index is used in the logic of the predicate function.

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

基于谓词并行筛选值序列。Filters in parallel a sequence of values based on a predicate.

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

类型参数

TSource

源的元素的类型。The type of the elements of source.

参数

source
ParallelQuery<TSource>

要筛选的序列。A sequence to filter.

predicate
Func<TSource,Boolean>

用于测试每个元素是否满足条件的函数。A function to test each element for a condition.

返回

一个序列,其中包含输入序列中满足条件的元素。A sequence that contains elements from the input sequence that satisfy the condition.

异常

sourcepredicate 为 null 引用(在 Visual Basic 中为 Nothing)。source or predicate is a null reference (Nothing in Visual Basic).

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

另请参阅

Where<TSource>(ParallelQuery<TSource>, Func<TSource,Int32,Boolean>)

基于谓词并行筛选值序列。Filters in parallel a sequence of values based on a predicate. 将在谓词函数的逻辑中使用每个元素的索引。Each element's index is used in the logic of the predicate function.

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

类型参数

TSource

源的元素的类型。The type of the elements of source.

参数

source
ParallelQuery<TSource>

要筛选的序列。A sequence to filter.

predicate
Func<TSource,Int32,Boolean>

用于测试每个元素是否满足条件的函数。A function to test each element for a condition.

返回

一个序列,其中包含输入序列中满足条件的元素。A sequence that contains elements from the input sequence that satisfy the condition.

异常

sourcepredicate 为 null 引用(在 Visual Basic 中为 Nothing)。source or predicate is a null reference (Nothing in Visual Basic).

已使用通过 WithCancellation 传递的令牌取消了查询。The query was canceled with the token passed in through WithCancellation.

该查询枚举的元素超过了 MaxValue 个。More than MaxValue elements are enumerated by the query.

评估查询期间发生一个或多个异常。One or more exceptions occurred during the evaluation of the query.

另请参阅

适用于