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

simple.data converts null to 0 #328

Open
john-qin opened this issue Jan 16, 2014 · 1 comment
Open

simple.data converts null to 0 #328

john-qin opened this issue Jan 16, 2014 · 1 comment

Comments

@john-qin
Copy link

I have a Price table in the sql server 2008 r2. one field is called "TotalPrice", its float, and it can be null.

when I select from this table, all null values converted to 0.

if I make it nullable in the domain object. even those are not null, are showing null. not sure I am doing something wrong or this is a bug.

public class Price
{
    public long? TotalPrice{ get; set; }
    Or
    public nullable<long>  TotalPrice{ get; set; }

}

@markrendle
Copy link
Owner

If you're using Nullable properties in the class, the properties should,
indeed, be null. I'll investigate that for you.

One point: if your SQL columns are floats, why are your properties long?

Mark Rendle
Founder & CEO
Oort Corporation
Makers of Zudio https://zud.io/

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

2 participants