Skip to content
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

When inserting double.NaN, Entity State is always Modified #93

Closed
NepPure opened this issue Aug 21, 2020 · 7 comments
Closed

When inserting double.NaN, Entity State is always Modified #93

NepPure opened this issue Aug 21, 2020 · 7 comments

Comments

@NepPure
Copy link

NepPure commented Aug 21, 2020

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.

@NepPure
Copy link
Author

NepPure commented Aug 21, 2020

Nullable double, insert NaN

public double? TestNumber {get; set;}

@alexkeh
Copy link
Member

alexkeh commented Aug 21, 2020

I've been able to reproduce the issue with EF Core 2.x and 3.1. I've filed bug 31785728 so that my dev team can investigate.

@NepPure
Copy link
Author

NepPure commented Aug 21, 2020

I've been able to reproduce the issue with Postgresql, may be a problem in ef core.

@alexkeh
Copy link
Member

alexkeh commented Aug 21, 2020

@roji

@roji
Copy link

roji commented Aug 21, 2020

Thanks for pinging me, there indeed seem to be some EF-side issues around NaN. Will post back soon.

@roji
Copy link

roji commented Aug 21, 2020

I've submitted a fix to EF Core, please take a look at npgsql/efcore.pg#1472 and dotnet/efcore#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 npgsql/efcore.pg#1472 which adds some functionality to the PostgreSQL provider (literal SQL generation and method translation for the testing methods on double).

@alexkeh
Copy link
Member

alexkeh commented Aug 21, 2020

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

@alexkeh alexkeh closed this as completed Aug 26, 2020
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

No branches or pull requests

3 participants