I am new to MVC, I use database first (sql server 2008) approach using EF6. What my problem is I am trying to save a decimal value with 3 decimal places, saving is okay but when I view it in my SQL Server 2008 database it saved 2 precise decimal places then followed by zeros.
For example I am trying to save 0.025, I can see it passed 0.025 in my save method but when I view what is saved in my db it is 0.0200, database data type is decimal(18,4). What am I doing wrong? Please help!
UPDATE:
I may have found similar question asked and answered that I have to set the decimal precision in model creating but how can I do this as it seem to be fitted only to code-first approach:
Set decimal(16, 3) for a column in Code First Approach in EF4.3
modelBuilder.Properties<decimal>().Configure(c => c.HasPrecision(18, 3));