Is there a way to store Enums as string names rather than ordinal values?
Example:
Imagine I\'ve got this enum:
public enum Gender
{
Fema
I ended up assigning values to enum items, as suggested by Chris Smith in a comment:
I'd avoid it. The string value takes up way more space than an integer. I would however, if persistence is involved give deterministic values to each item in your enum so
Female = 1,Male = 2so if the enum is added to later or the order of items changed that you don't end up with problems.
Not exactly what I was looking for but it seems there's no other way around.