ToString()
on an enum
value which has multiple corresponding names?Long explanation
The behavior is undefined. Even if you are able to show what the result is for some specific version of .NEt it could change. See the enum.toString documentation, which says:
If multiple enumeration members have the same underlying value and you attempt to retrieve the string representation of an enumeration member's name based on its underlying value, your code should not make any assumptions about which name the method will return. For example, the following enumeration defines two members, Shade.Gray and Shade.Grey, that have the same underlying value.
enum Shade { White = 0, Gray = 1, Grey = 1, Black = 2 }
The following method call attempts to retrieve the name of a member of the Shade enumeration whose underlying value is 1. The method can return either "Gray" or "Grey", and your code should not make any assumptions about which string will be returned.
string shadeName = ((Shade) 1).ToString();
Also see the previous paragraph is documentation, which shows how to retrieve all names