Compare two objects that contain enum values of the same enum type
- by Rire1979
I have an enum type defined: EnumType
Now imagine
object A = EnumType.Value1;
object B = EnumType.Value2;
I would like to make the comparison ( A == B ) give me the correct result independent of the type of Enum used. In the comparison, the object will always contain enums, and both will be of the same type.
How can I achieve this?