Hi, I want to store 3 decimal places in my db aspnetzero app but it does not allow me. When I save a record aspnetzero only keeps two (2) decimal places. Please advice an dwhich class I should to check, thanks
8 Answer(s)
-
0
Hi,
You can do it in OnModelCreating of your db context for a single property like this.
modelBuilder.Entity<YourEntity>().Property(p => p.YourProperty).HasPrecision(18, 3);
Then add necessay EF code first migration and update your database.
-
0
Sorry to bother you Ismail
I have the same issue
My DB datatype is numeric(18,6) but when I am storing more than 2 digits. It is always getting stored only 2 digits
Plesase check it from your end
This is going to be massive blocker for us
Please help us to solve this
-
0
Hi,
I think your problems happens when you call a appService from client side ? If that is right, your problem is related to Json.Net I think.
You can take a look at this issue, there is an offered solution, you can try that. <a class="postlink" href="http://stackoverflow.com/questions/17855746/webapi-json-net-and-losing-decimal-precision">http://stackoverflow.com/questions/1785 ... -precision</a>
-
0
-
0
Did you also set precision for your field in OnModelCreating of your DbContext and added the migration ?
-
0
Yes I have done that... Still same
-
0
Could you please update me ?
It's urgent Please
-
0
Hi,
I couldn't reproduce it. Can you share your entitiy and your onmodelcreating code? Maybe i can reproduce with your code.
If there is something special in menuItemManager's updateAsync please share its code as well.