Page 1 of 1

Double.NaN is stored and retrieved as null (EF6 Code First)

Posted: Tue 18 Sep 2018 09:31
by bairog
Hello.
Assume we have the following entity:

Code: Select all

    public class User
    {
        public Guid Id { get; set; }
        public String Name { get; set; }
        public Double? Age { get; set; }  
    } 
User with Age=Double.NaN is stored to database and retrieved from it as null (column type is real, null is allowed).
User with Age=null is also stored to database and retrieved from it as null (that works as I expect).
Double.PositiveInfinity and Double.NegativeInfinity are also saved and retrieved correctly.

So why Double.NaN is not working?

I use dotConnect for SQLite 5.11.1202.

Re: Double.NaN is stored and retrieved as null (EF Code First)

Posted: Sat 22 Sep 2018 17:29
by Shalex
Thank you for your report. You are working with EF6, aren't you? We have reproduced the issue. We will investigate it and notify you about the result.

Re: Double.NaN is stored and retrieved as null (EF Code First)

Posted: Wed 24 Oct 2018 05:07
by bairog
Yes, I use EF6.
So how is your investigation going?

Re: Double.NaN is stored and retrieved as null (EF6 Code First)

Posted: Fri 26 Oct 2018 18:20
by Shalex
The investigation is in progress. As soon as we have any result, we will let you know.

Re: Double.NaN is stored and retrieved as null (EF6 Code First)

Posted: Tue 08 Oct 2019 07:59
by bairog
Hello again.
Is there a workaround for today? We really need to read Double.NaN.
Thank you.

Re: Double.NaN is stored and retrieved as null (EF6 Code First)

Posted: Sat 12 Oct 2019 15:46
by Shalex
There is no workaround for EF6.

EF Core 2 allows solving the issue with a value converter (store value as a string).