amelianairobi
New Member
I have an entity with a NrPeso decimal property that can be saved in the database as 0 or null.Here is what I'm doing to assign the value to the property:\[code\]entity.NrPeso = Convert.ToDecimal(object.value("value"))\[/code\]The problem is: if I don't fill the object value, it's set to \[code\]Nothing\[/code\]. When I do the cast it turns into 0. But I don't want 0, I want \[code\]Nothing\[/code\]. If I compare the object value with \[code\]Nothing\[/code\] it will return me \[code\]Nothing\[/code\] if it is Nothing or 0.I tought in a few alternatives but they don't seem good.So, what is the right way to do this?