c# enum equals() vs ==

If the compile-time type of enumInstance is the enum type, you’re fine with ==.

If the compile-time type of enumInstance is Enum, ValueType or Object, you need to use Equals. (You’ll get a compile-time error if you try to use == in that case.)

Note that your enum currently violates .NET naming conventions – it would normally be MyEnum.Value.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)