Answers for "get enum names"

C#
0

Get Enum Name

//Option 1:
string m = Enum.GetName(typeof(MyEnumClass), value);
//Option 2:
string n = nameof(MyEnumClass.Value);
Posted by: Guest on June-07-2021
0

Get Enum Name

int value = GetValueFromDb();
var enumDisplayStatus = (EnumDisplayStatus)value;
string stringValue = enumDisplayStatus.ToString();
Posted by: Guest on March-27-2022

C# Answers by Framework

Browse Popular Code Answers by Language