Open tcortega opened 2 months ago
This is easily addressed by using [GreaterThan(0m)]
. Further consideration is not warranted as integers are the only values where this type of mismatch is possible, and suffixes, which are common, are easily added.
Decimals can't be constants. That's where the issue arises.
It's unfortunate that I'm forced to disable warnings using
pragma
when utilizing theGreaterThanAttribute
with properties of type decimal or similar. For example:This results in the following warning:
Having a way to relax the constraints of
[TargetType]
or an option to toggle a strict mode would significantly improve this experience. Because this becomes unbearable if your project is treating warnings as errors.