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

定义

ParallelQuery<TSource> 转换为 IEnumerable<T> 以强制对查询进行顺序计算。Converts a ParallelQuery<TSource> into an IEnumerable<T> to force sequential evaluation of the query.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<TSource> ^ AsEnumerable(System::Linq::ParallelQuery<TSource> ^ source);
public static System.Collections.Generic.IEnumerable<TSource> AsEnumerable<TSource> (this System.Linq.ParallelQuery<TSource> source);
static member AsEnumerable : System.Linq.ParallelQuery<'Source> -> seq<'Source>
<Extension()>
Public Function AsEnumerable(Of TSource) (source As ParallelQuery(Of TSource)) As IEnumerable(Of TSource)

类型参数

TSource

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

参数

source
ParallelQuery<TSource>

要强制转换为 IEnumerable<T> 的序列。The sequence to cast as IEnumerable<T>.

返回

IEnumerable<TSource>

已作为 IEnumerable<T> 键入的输入序列。The input sequence typed as IEnumerable<T>.

异常

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

适用于

另请参阅