I have the following enumeration:
public enum AuthenticationMethod
{
FORMS = 1,
WINDOWSAUTHENTICATION = 2,
SINGLESIGNON = 3
}
T
old post but...
The answer to this may actually be very simple. Use Enum.ToString() function
There are 6 overloads of this function, you can use Enum.Tostring("F") or Enum.ToString() to return the string value. No need to bother with anything else. Here is a working Demo
Note that this solution may not work for all compilers (this demo does not work as expected) but at least it works for the latest compiler.