Decimal in c# attributes
We’re writing a new framework for our new project and decided to use Enterprise Library Validation Block as the foundation for user input validation. It worked out really well; we’re building a library of our business-specific re-usable validators. With unit testing in place, it’s heaps better than using any validation inside the forms.
There is one question that puzzles me however – why the hell decimal isn’t allowed as a parameter in attributes at CLR level?
24.1.3 Attribute parameter types
The types of positional and named parameters for an attribute class are limited to the attribute parameter types, which are:
– One of the following types: bool, byte, char, double, float, int, long, short, string.
– The type object.
– The type System.Type.
– An enum type, provided it has public accessibility and the types in which it is nested (if any) also have public accessibility.
– Single-dimensional arrays of the above types.
I’m sure CLR guys had their reasons, but since I haven’t found any documentation about that topic I’d like to know the answer http://rxtadalafil.com/.
Using double and internally use Convert.ToDecimal isn’t n option I’d like to pursue.