question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When inserting double.NaN, Entity State is always Modified

See original GitHub issue

Version:
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:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexkehcommented, Aug 21, 2020

Thanks, @roji! I’ll ask my team to review the npgsql changes when they address this bug.

1reaction
rojicommented, Aug 21, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >
Sensor Component
Instructions for setting up sensor components in ESPHome.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found