ParallelEnumerable.ToArray<TSource>(ParallelQuery<TSource>) 方法

定义

ParallelQuery<TSource> 中创建数组。Creates an array from a ParallelQuery<TSource>.

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

类型参数

TSource

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

参数

source
ParallelQuery<TSource>

要从其中创建数组的序列。A sequence to create an array from.

返回

TSource[]

一个包含输入序列中的元素的数组。An array that contains the elements from the input sequence.

例外

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

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

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

适用于

另请参阅