get value of enum c# code example
Example 1: c# get all enum values
var values = Enum.GetValues(typeof(Foos));
Example 2: c# get enum name from value
string name=(weekdays)2;//returns weekdays which has value 2.Here weekdays is enum name
Example 3: get enum value c#
int something = (int) Question.Role;
Example 4: c# get value of object in enum
arrayName variable = (arrayName) index
//for example
Days day = (Days)3;