Edit

Share via


ConfiguredCancelableAsyncEnumerable<T>.WithCancellation Method

Definition

Sets the CancellationToken to be passed to GetAsyncEnumerator(CancellationToken) when iterating.

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)

Parameters

cancellationToken
CancellationToken

The CancellationToken to use.

Returns

The configured enumerable.

Remarks

This will replace any previous CancellationToken set by WithCancellation(CancellationToken) for this iteration.

Applies to