Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


TaskAsyncEnumerableExtensions.WithCancellation<T> Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

C#
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken);

Type Parameters

T

The type of the objects being iterated.

Parameters

source
IAsyncEnumerable<T>

The source enumerable being iterated.

cancellationToken
CancellationToken

The CancellationToken to use.

Returns

The configured enumerable.

Applies to

Termék Verziók
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1