-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Problem to eliminating 'Sequence contains no elements' error. #20589
Comments
@maumar Verified that this still fails on recent daily build. Output:
|
@smitpatel Since I didn't get any comments to me on this, can I know what happened? Can you tell me the version that might have a fix? |
@SoftCircuits It will first appear in 5.0 preview 4, or you can try the daily builds. |
Is there any chance to see that fix in 3.1 branch? By the way it's an LTS release and should still get bugfixes like this one. I don't want to switch to 5.0 to get this thing working. |
I agree with anri-vin. We can't upgrade EF Core to 5.0 because of company policy, while EF 3.1 is LTS. Are there any public rules for determining which defect should be fixed in LTS? |
Just faced this issue, the workaround for now requires an extra query ( I'd appreciate it if this was fixed in 3.1. |
When
DbContext.Areas
has no records, the following code throws an exception:The standard way of working around this is to use
DefaultIfEmpty()
. But that doesn't work here either.I also tried setting an explicit default value. That gives me a different error.
I also tried a manual workaround. And that doesn't work either.
Ideally, I would just add
DefaultIfEmpty()
here and be good to go. This shouldn't be so difficult.Further technical details
EF Core version: 3.1.3
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.1
Operating system: Windows 10
IDE: 16.5.1
The text was updated successfully, but these errors were encountered: