Skip to content
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

Remove IAsyncEnumerable from DbSet #24145

Merged
merged 4 commits into from
Feb 18, 2021
Merged

Remove IAsyncEnumerable from DbSet #24145

merged 4 commits into from
Feb 18, 2021

Conversation

roji
Copy link
Member

@roji roji commented Feb 13, 2021

Fixes #24041

Some compat notes:

  • await foreach works fine, even if LangVersion is set to 7.0. Am not sure if this is because the SDK is new - if so, then new SDKs are required to build anything depending on EF Core 6.0 anyway (since we target net5.0).
  • ToListAsync and friends work fine because they're over IQueryable

@roji roji requested a review from smitpatel February 13, 2021 10:05
src/EFCore/DbSet.cs Outdated Show resolved Hide resolved
(binary breaking changes in ASP.NET tests)
@roji roji force-pushed the RemoveIAsyncEnumerable branch from 602e4a7 to 82e0573 Compare February 13, 2021 10:33
@roji roji marked this pull request as ready for review February 13, 2021 15:38
@Youssef1313
Copy link
Member

await foreach works fine, even if LangVersion is set to 7.0. Am not sure if this is because the SDK is new - if so, then new SDKs are required to build anything depending on EF Core 6.0 anyway (since we target net5.0).

The SDK doesn't seem related I think. This is a compiler-specific thing. The compiler is expected to issue a compile-warning if await foreach is used but the type doesn't have GetAsyncEnumerator method (regardless whether it comes from the interface or not).

It's very odd that await foreach is still working. I can't think of a reason.

@roji
Copy link
Member Author

roji commented Feb 13, 2021

The SDK doesn't seem related I think. This is a compiler-specific thing.

Yeah, I was referring to the compiler, which is delivered as part of the SDK.

Regardless, I agree this is odd, though unlikely to be important here specifically. Since EF Core 6.0 will target .NET 5.0 at a minimum, the default langversion is 9.0 in any case (and users will always have the option to use AsAsyncEnumerable if they need to).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove IAsyncEnumerable from DbSet
3 participants