I'd like to set a property as an Enum so only certain values can be stored but when getting the property, I'd like to get a string value.
So for example, store an Enum of Orange1
but get "Orange 1".
Is this possible? If not, what would be the best way to achieve this?
One way would be to use a Description attribute. Let's create an Enum that looks like this:
Now in a Module, add the following extension method:
Then, you can do something like this: