No, you can just simply overlay on an int:
(int)MyEnum.MyEnumCode
Working out a bit. The internally enumeration is actually an int. Therefore, the throw is free. But it also means that you can easily have values in your listing that don't exist. For instance.
MyEnum val = (MyEnum)-123544;
Perfectly valid code.
source share