KEMBAR78
Remove IAsyncEnumerable from DbSet by roji · Pull Request #24145 · dotnet/efcore · GitHub
Skip to content

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
(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