I have an enum like this :
public enum Priority
{
Low = 0,
Medium = 1,
Urgent = 2
}
And I want to get the for example Priority.Low by passing like Enum.GetEnumVar(Priority,0) which should return Priority.Low
How can I accomplish that ?
Thank you in advance.
Simply cast it to the enum type:
Note that you can cast any int to Priority, not only those which have a name:
(Priority)42is valid.