Closed
Description
Background and Motivation
Hello, I'm an asp.net core developer. While I using the input validation, I found it is hard to validate the decimal type.
I try these:
[Range(typeof(decimal), "0", decimal.MaxValue.ToString())]
This one compile error.
[Range(0d, (double)decimal.MaxValue)]
Works but it will lost the precision.
After I search google and stackoverflow, I found the solution:
[Range(typeof(decimal), "0", "79228162514264337593543950335")]
It is not friendly for code.
Also as @Joe4evr said, decimal type can not be an attribute parameter due to the CLR restriction.