What's the way to add decimal number to SQL th

2019-06-02 10:45发布

问题:

I already tried with decimal(10,4) and float in the SQL but after I updated my Database model the EF treat

decimal(10,4) as a Decimal in C#
float as a Double in C#

witch for me it's great, but the Model Validation always fail

and it's not because I'm using . instead of ,

What should I do so the validation can run smoothly?

I know I can avoid this using a ModelView in between the View and the Model, but I just want to know how to do things right.

回答1:

got the problem, it's not me... it's .NET really :)

http://haacked.com/archive/2011/03/19/fixing-binding-to-decimals.aspx