-
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
SumAsync throw Exception when used over float? #12314
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
type-bug
Milestone
Comments
iyhammad
changed the title
SumAsync throw Exception when used over owned type
SumAsync throw Exception when used over float?
Jun 9, 2018
regression introduced in 4bb6c38 - in order to produce 0 for sum of empty collections we strip the nullability and then try to cast the result back to nullable. This doesn't work for async because Task, hence the exception. |
maumar
added a commit
that referenced
this issue
Jun 13, 2018
Problem was that in order to return 0 from empty Sum of nullable values, we convert them to non-nullable (to produce 0) and then convert back to nullable type. This works without issue for sync path, but in async simple casting like that doesn't work. Fix is to call method that adds Task.ContinueWith() call that casts the result to the correct type in the async scenario.
maumar
added a commit
that referenced
this issue
Jun 14, 2018
Problem was that in order to return 0 from empty Sum of nullable values, we convert them to non-nullable (to produce 0) and then convert back to nullable type. This works without issue for sync path, but in async simple casting like that doesn't work. Fix is to call method that adds Task.ContinueWith() call that casts the result to the correct type in the async scenario.
Closed
maumar
added a commit
that referenced
this issue
Jun 19, 2018
Problem was that in order to return 0 from empty Sum of nullable values, we convert them to non-nullable (to produce 0) and then convert back to nullable type. This works without issue for sync path, but in async simple casting like that doesn't work. Fix is to call method that adds Task.ContinueWith() call that casts the result to the correct type in the async scenario.
ajcvickers
added
type-bug
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
Servicing-consider
patch-approved
and removed
type-investigation
Servicing-consider
labels
Jun 20, 2018
@maumar This issue is approved for patch and the release\2.1 branch is now open for merging. Please ensure:
|
maumar
added a commit
that referenced
this issue
Jun 29, 2018
Problem was that in order to return 0 from empty Sum of nullable values, we convert them to non-nullable (to produce 0) and then convert back to nullable type. This works without issue for sync path, but in async simple casting like that doesn't work. Fix is to call method that adds Task.ContinueWith() call that casts the result to the correct type in the async scenario.
This was referenced Jul 30, 2021
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
type-bug
SumAsync is throwing
System.InvalidOperationException: No coercion operator is defined between types 'System.Threading.Tasks.Task`1[System.Single]' and 'System.Nullable`1[System.Single]'.
when using it over an owned type.when used with float? after upgrading from EFCore 2.0 to 2.1Exception Details
Steps to reproduce
below the same owner & owned entities and the exception happens only with the SumAsync
##LeaveRequestRepository .cs
Further technical details
EF Core version: 2.1.0
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10 Enterprise, Build: 17134.48
IDE: Visual Studio 2017 15.7.3
The text was updated successfully, but these errors were encountered: