Wednesday, February 13, 2013

EF decimal precision

Encountered a strange problem at work. Entity framework code first, entity's decimal field always save to 2 decimal points even though the field has 4. Turned out in EF4 you need to specify percision: modelBuilder.Entity().Property(e=> e.property).HasPrecision(x, d);

No comments: