When inserting double.NaN, Entity State is always Modified
See original GitHub issueVersion:
https://www.nuget.org/packages/Oracle.EntityFrameworkCore/2.19.80
After calling dbcontext.SaveChanges
, the state of the entity becomes Modified
.
This may be a problem in implementing the double type comparison.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Entity State Always Changed to Modified
My problem is that when assigning a value to a property that is identical to its current value the above code bypasses the...
Read more >V3076. Comparison with 'double.NaN' is meaningless. Use ...
The analyzer detected that a variable of type float or double is compared with a float.NaN or double.NaN value. As stated in the...
Read more >Working with entity states - EF6
Modified entities are updated in the database and then become Unchanged when SaveChanges returns.
Read more >Moving function aggregation | Elasticsearch Guide [8.9]
If the window is empty, or all values are null / NaN , NaN is returned as the result. Table 66. min(double[] values)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, @roji! I’ll ask my team to review the npgsql changes when they address this bug.
I’ve submitted a fix to EF Core, please take a look at https://github.com/npgsql/efcore.pg/pull/1472 and https://github.com/dotnet/efcore/pull/22168. The code in the PR can be used as-is inside a provider’s mapping, so you shouldn’t need to block on the PR getting merged.
See also https://github.com/npgsql/efcore.pg/pull/1472 which adds some functionality to the PostgreSQL provider (literal SQL generation and method translation for the testing methods on double).