ParallelEnumerable.WithExecutionMode(ParallelQuery<TSource>, ParallelExecutionMode) ParallelEnumerable.WithExecutionMode(ParallelQuery<TSource>, ParallelExecutionMode) ParallelEnumerable.WithExecutionMode(ParallelQuery<TSource>, ParallelExecutionMode) ParallelEnumerable.WithExecutionMode(ParallelQuery<TSource>, ParallelExecutionMode) Method

Definição

Define o modo de execução da consulta.Sets the execution mode of the query.

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

Parâmetros de tipo

TSource

O tipo dos elementos de source.The type of elements of source.

Parâmetros

source
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

Um ParallelQuery no qual definir a opção.A ParallelQuery on which to set the option.

executionMode
ParallelExecutionMode ParallelExecutionMode ParallelExecutionMode ParallelExecutionMode

O modo no qual executar a consulta.The mode in which to execute the query.

Retornos

O ParallelQuery que representa a mesma consulta como fonte, mas com o modo de execução registrado.ParallelQuery representing the same query as source, but with the registered execution mode.

Exceções

source é uma referência nula (Nada no Visual Basic).source is a null reference (Nothing in Visual Basic).

executionMode não é um valor ParallelExecutionMode válido.executionMode is not a valid ParallelExecutionMode value.

WithExecutionMode é usado várias vezes na consulta.WithExecutionMode is used multiple times in the query.

Comentários

O modo de execução especifica se o PLINQ tentará fazer fallback para a execução sequencial se detectar determinadas formas de consulta.The execution mode specifies whether PLINQ will attempt to fall back to sequential execution if it detects certain query shapes. Para obter mais informações e exemplos, confira Como Especificar o modo de execução em PLINQ.For more information and examples, see How to: Specify the Execution Mode in PLINQ.

Aplica-se a

Veja também