entity framework - Breeze - Saving decimal type has wrong scale? -


i'm using latest breezejs (1.5.3) data operations in sql server entity framework. save operation done successfully. savemap has decimal value full scale after update field in db has wrong scale (number of decimal points).
e.g savemap has value 565.13435435 persisted in db field decimal(19,5) after update field has 2 decimal points

this ef problem. default scale decimal types in ef 2. have tell ef scale column. if need 4 decimal places, use shortcut saying money type:

[column(typename = "money")] public decimal mydecimalvalue { get; set; } 

but other cases, need specify precision in onmodelcreating method of dbcontext:

protected override void onmodelcreating(dbmodelbuilder modelbuilder) {     // configure precision match specified in database     modelbuilder.entity<myentity>().property(p => p.mydecimalvalue).hasprecision(19, 5); } 

Comments

Popular posts from this blog

methods - python can't use function in submodule -

Java 3D LWJGL collision -

c# - ErrorThe type or namespace name 'AxWMPLib' could not be found (are you missing a using directive or an assembly reference?) -