Partilhar via


ConfiguredCancelableAsyncEnumerable<T>.WithCancellation Método

Definição

Define o CancellationToken a ser passado para GetAsyncEnumerator(CancellationToken) ao iterar.

public:
 System::Runtime::CompilerServices::ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System::Threading::CancellationToken cancellationToken);
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation (System.Threading.CancellationToken cancellationToken);
member this.WithCancellation : System.Threading.CancellationToken -> System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<'T>
Public Function WithCancellation (cancellationToken As CancellationToken) As ConfiguredCancelableAsyncEnumerable(Of T)

Parâmetros

cancellationToken
CancellationToken

O CancellationToken a ser usado.

Retornos

O enumerável configurado.

Comentários

Isso substituirá todos os CancellationToken anteriores definidos por WithCancellation(CancellationToken) para essa iteração.

Aplica-se a