Skip to content

Updates to IAsyncEnumerable breaking change #45775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions docs/core/compatibility/core-libraries/10.0/asyncenumerable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ ms.custom: https://github.com/dotnet/docs/issues/44886

# System.Linq.AsyncEnumerable in .NET 10

.NET 10 introduces the `AsyncEnumerable` class, which provides a full set of LINQ extension methods for the <xref:System.Collections.Generic.IAsyncEnumerable`1> type. This class replaces the community-maintained `System.Linq.Async` NuGet library, potentially causing compilation errors due to ambiguities.
.NET 10 introduces the <xref:System.Linq.AsyncEnumerable> class, which provides a full set of LINQ extension methods for the <xref:System.Collections.Generic.IAsyncEnumerable`1> type. This class replaces the [community-maintained `System.Linq.Async` NuGet library](https://www.nuget.org/packages/System.Linq.Async), potentially causing compilation errors due to ambiguities.

## Version introduced

.NET 10 Preview 1

## Previous behavior

The `AsyncEnumerable` class in the `System.Linq.Async` package provided LINQ support for <xref:System.Collections.Generic.IAsyncEnumerable`1>.
The `AsyncEnumerable` class in the [community-maintained `System.Linq.Async` package](https://www.nuget.org/packages/System.Linq.Async) provided LINQ support for <xref:System.Collections.Generic.IAsyncEnumerable`1>.

## New behavior

The `AsyncEnumerable` class in .NET 10, as well as in the `System.Linq.AsyncEnumerable` NuGet package, provides LINQ support for <xref:System.Collections.Generic.IAsyncEnumerable`1>.
The <xref:System.Linq.AsyncEnumerable> class in .NET 10, and in the [`System.Linq.AsyncEnumerable` NuGet package](https://www.nuget.org/packages/System.Linq.AsyncEnumerable/), provides LINQ support for <xref:System.Collections.Generic.IAsyncEnumerable`1>.

## Type of breaking change

This is a [source incompatible](../../categories.md#source-compatibility) change.

## Reason for change

<xref:System.Collections.Generic.IAsyncEnumerable`1> has become core enough that the platform itself should provide LINQ support for the type. Community support, including from the maintainers of `System.Linq.Async`, petitioned for this inclusion directly in the platform.
<xref:System.Collections.Generic.IAsyncEnumerable`1> is a commonly used interface, so the platform itself should provide LINQ support for the type. Maintainers of `System.Linq.Async` and other community members petitioned for inclusion directly in the platform.

## Recommended action

Expand All @@ -42,9 +42,12 @@ If `System.Linq.Async` is consumed indirectly via another package, avoid ambigui
</PackageReference>
```

Most consuming code will not need changes, but some call sites might need updates to refer to newer names and signatures.
Most consuming code should be compatible without changes, but some call sites might need updates to refer to newer names and signatures.

Refer to the [System.Linq.AsyncEnumerable API documentation](xref:System.Linq.AsyncEnumerable) for the full set of LINQ extension methods available for <xref:System.Collections.Generic.IAsyncEnumerable`1>.

## Affected APIs

- `System.Linq.AsyncEnumerable`
- <xref:System.Collections.Generic.IAsyncEnumerable`1>
- <xref:System.Linq.AsyncEnumerable?displayProperty=fullName>
- <xref:System.Collections.Generic.IAsyncEnumerable`1?displayProperty=fullName>
- [System.Linq.Async package](https://www.nuget.org/packages/System.Linq.Async) (community-maintained)