开发者

Nhibernate: Save all decimal properties with only two decimal numbers

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜