Decimal precision nhibernate with precision and scaling

inside db I have a field that is decimal(9, 6)

Nhibernate will save this data by losing the last digit in decimal(9, 5) format decimal(9, 5)

The question is how to display the field using nhib. code mapping for using precision 9.6

 Property( x=>x.Longitude // precision and scale ); 
+4
source share
1 answer

you can explicitly point out this type of accuracy and scale similar to this

 Property( x => x.Longitude, m => { m.Precision(9); m.Scale(6); } ); 

or you can set all decimal numbers in the agreements in your application, this is out of this question (just an idea).

Hope this helps

+7
source

Source: https://habr.com/ru/post/1469440/


All Articles