Skip to content

Migration to .NET 10 is unclear #2283

@Leon99

Description

@Leon99

I feel like I'm missing something obvious here but couldn't find an explanation anywhere, and MS documentation on this is rather brief...

await Enumerable.Range(1, 10)
                .ToAsyncEnumerable()
                .SelectAwait(async i => await Task.FromResult(i))
                .FirstAsync()

returns int, but SelectAwait is now obsolete with explanation "Use Select", however

await Enumerable.Range(1, 10)
                .ToAsyncEnumerable()
                .Select(async i => await Task.FromResult(i))
                .FirstAsync()

returns Task<int>, so Select is not a direct replacement as it'd need to be wrapped in something like await Task.WhenAll(...ToArrayAsync()) to get the same result. What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions