ParallelEnumerable.ElementAt<TSource> 方法

定义

返回并行序列中指定索引处的元素。

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

类型参数

TSource

的元素 source的类型。

参数

source
ParallelQuery<TSource>

要从中返回元素的序列。

index
Int32

要检索的元素的从零开始的索引。

返回

TSource

源序列中指定位置处的元素。

例外

source 是空引用(Visual Basic 中没有任何内容)。

index 小于 0 或大于或等于中的 source元素数。

在查询评估期间发生一个或多个异常。

适用于

另请参阅