How can an int be cast to an enum in C#?
int
enum
I need two instructions:
YourEnum possibleEnum = (YourEnum)value; // There isn't any guarantee that it is part of the enum if (Enum.IsDefined(typeof(YourEnum), possibleEnum)) { // Value exists in YourEnum }