IAsyncEnumerable<T>.GetAsyncEnumerator(CancellationToken) Method

Definition

Returns an enumerator that iterates asynchronously through the collection.

C#
public System.Collections.Generic.IAsyncEnumerator<out T> GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken = default);

Parameters

cancellationToken
CancellationToken

A CancellationToken that may be used to cancel the asynchronous iteration.

Returns

An enumerator that can be used to iterate asynchronously through the collection.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1