I´m having a problem when trying to use a view Model that as a decimal property. Because my decimal region/culture format uses "," and not "." as decimal separator.
When I try to post that model, I get the following error:
The value xxx is not valid for the "field".
I´m using jquery.unobstrusive and jquery.validation. So when I make the submit the model get validated and a error is shown an a label with the error above.
The thing is, the property does not have any kind of attributes (Required,Regex,Range). So that error is produced by the middleware/framework when trying to parse the string to decimal.
If I type a decimal like: 40.05 the form submit with success.
If I type a decimal like: 40,05 the form submit fails with the above error.
I have already read about Globalization at:
https://docs.asp.net/en/latest/fundamentals/localization.html#globalization-and-localization-terms
but could not find the "path" trought setting my globalization culture. At MVC4/5 we were used to add a web.config tag at system.web and that's it. But at MVC6 that doesn´t seem to be the way.
Any tips?