A better enumeration - Type safe from start to end
Enumerations are one of the fundamental value types in C#. enum
's are handy if you have a constrained set of allowed values.
But the enum
type has also a lot of drawbacks. Personally one major issue for me, is that you can't define methods inside the enum. Plus you can just pass them invalid values and it just works (Todd Howard I'm looking at you).
So why not make a lightweight alternative which removes a lot of the shortcomings of an enum
?