ParallelEnumerable.OfType<TResult>(ParallelQuery) 方法

定义

根据指定类型筛选 ParallelQuery 的元素。Filters the elements of a ParallelQuery based on a specified type.

public:
generic <typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TResult> ^ OfType(System::Linq::ParallelQuery ^ source);
public static System.Linq.ParallelQuery<TResult> OfType<TResult> (this System.Linq.ParallelQuery source);
static member OfType : System.Linq.ParallelQuery -> System.Linq.ParallelQuery<'Result>
<Extension()>
Public Function OfType(Of TResult) (source As ParallelQuery) As ParallelQuery(Of TResult)

类型参数

TResult

筛选序列元素所根据的类型。The type to filter the elements of the sequence on.

参数

source
ParallelQuery

具有要筛选元素的序列。The sequence with elements to filter.

返回

ParallelQuery<TResult>

一个序列,其中包含按类型筛选的输入序列中的元素。A sequence that contains elements from the input sequence filtered by type.

例外

source 为 null 引用(在 Visual Basic 中为 Nothing)。source 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.

适用于

另请参阅