enums

I know many people have written about this one, but it’s cropped up yet again in the app I’m maintaining. The old chestnut of setting a string based on an enum value – when the enum names are identical to the string values (most often with one word names).

There’s other ways to do this if you want more of a ‘description’ (e.g. multiple words). The StringEnum class could do it for you, or you could provide your own implementation with a Description attribute on the values – e.g. [Description(“My extended value name”)]