开发者

Decimals in schema generated by EF being set to 0 decimal places?

开发者 https://www.devze.com 2023-03-05 04:12 出处:网络
I\'ve noticed that whenever I generate a database schema from an EF model that includes decimal fi开发者_如何学JAVAelds the SQL type used is decimal(18,0) - this causes all decimal values to be effect

I've noticed that whenever I generate a database schema from an EF model that includes decimal fi开发者_如何学JAVAelds the SQL type used is decimal(18,0) - this causes all decimal values to be effectively truncated to integers on persistence to the database.

Is there a configuration option or setting that can be applied to control the default precision of all SQL decimal types that are generated?


You can change scale and precision in the designer. Select the property in your entity and in Properties window change values as you need.

Decimals in schema generated by EF being set to 0 decimal places?

0

精彩评论

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