开发者

Nhibernate: Save all decimal properties with only two decimal numbers

开发者 https://www.devze.com 2023-02-19 23:02 出处:网络
Is there a way to tell nhibernate to save all the numeric properties with only two decimals? I\'m using fluent nhi开发者_开发知识库bernate.In addition to @gsco\'s answer if you need to apply this acro

Is there a way to tell nhibernate to save all the numeric properties with only two decimals? I'm using fluent nhi开发者_开发知识库bernate.


In addition to @gsco's answer if you need to apply this across classes for all numeric properties, you can define a PropertyConvention and specify the override.


You need to do something similar to this in your mapping.

Map(x => x.Amount).Precision(8).Scale(2);
0

精彩评论

暂无评论...
验证码 换一张
取 消