In C#, is it possible to decorate an Enum type with an attribute or do something else to specify what the default value should be, without having the change the values? The
Actually an enum's default is the first element in the enum whose value is 0.
enum
0
So for example:
public enum Animals { Cat, Dog, Pony = 0, } //its value will actually be Cat not Pony unless you assign a non zero value to Cat. Animals animal;