How can an int be cast to an enum in C#?
int
enum
Sometimes you have an object to the MyEnum type. Like
MyEnum
var MyEnumType = typeof(MyEnum);
Then:
Enum.ToObject(typeof(MyEnum), 3)