Skip to content

GetAsyncEnumerator is not GetEnumeratorAsync #26742

Open
@deep-outcome

Description

@deep-outcome

Method that returns System.Collections.Generic.IAsyncEnumerator<out T> is called Get**Async**Enumerator thus code sample

int num = 0;
var enumerator = runPagedQueryAsync(client, PagedIssueQuery, "docs").GetEnumeratorAsync();
try
{
    while (await enumerator.MoveNextAsync())
    {
        var issue = enumerator.Current;
        Console.WriteLine(issue);
        Console.WriteLine($"Received {++num} issues in total");
    }
} finally
{
    if (enumerator != null)
        await enumerator.DisposeAsync();
}

is wrong – is states GetEnumerator**Async** like it is usually used for async methods.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions