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
If you define the Default enum as the enum with the smallest value you can use this:
public enum MyEnum { His = -1, Hers = -2, Mine = -4, Theirs = -3 } var firstEnum = ((MyEnum[])Enum.GetValues(typeof(MyEnum)))[0]; firstEnum == Mine.
This doesn't assume that the enum has a zero value.