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);
精彩评论