Wednesday, March 13, 2013

How to get C# Enum description from value?

How to get C# Enum description from value?
int value = 1;
string description = Enumerations.GetEnumDescription((MyEnum)value);
The default underlying data type for an enum in C# is an int, you can just cast it.
Read this: https://code.google.com/p/unconstrained-melody/

No comments:

Post a Comment