I wouldn’t refuse just C I would reject any value other than A and B :
if (e != Enumeration.A && e != Enumeration.B) { throw new ArgumentOutOfRangeException("e"); }
This is important, as otherwise people might call:
Method((Enumeration) -1);
and that will do your check. You always need to know that an enumeration is just a collection of named integers, but any integer of the right base type can be transferred to an enumeration type.
source share