ParallelEnumerable.AsSequential<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> ^ AsSequential(System::Linq::ParallelQuery<TSource> ^ source);
public static System.Collections.Generic.IEnumerable<TSource> AsSequential<TSource> (this System.Linq.ParallelQuery<TSource> source);
static member AsSequential : System.Linq.ParallelQuery<'Source> -> seq<'Source>
<Extension()>
Public Function AsSequential(Of TSource) (source As ParallelQuery(Of TSource)) As IEnumerable(Of TSource)

类型参数

TSource

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

参数

返回

IEnumerable<TSource>

作为要绑定到顺序扩展方法的 IEnumerable<T> 的源。The source as an IEnumerable<T> to bind to sequential extension methods.

异常

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

注解

有关详细信息,请参阅plinq 中的顺序保留如何:控制 plinq 查询中的排序For more information, see Order Preservation in PLINQ and How to: Control Ordering in a PLINQ Query.

适用于

另请参阅