MessageType type1 = new MessageType("type1"); MessageType type2 = new MessageType("type2"); if (type1.Equals(type2)) { // do something } else { // do something else }
MessageType type1 = new MessageType("type1"); MessageType type2 = new MessageType("type1"); if (type1.Equals(type2)) { // do something } else { // do something else }This example creates two message types, "type1" and "type2", both with the same value. The Equals method is used to check if they are equal, and since they are, the code will execute the "do something" block. The package library for MessageType Equals is most likely the C# standard library, as it is a built-in method in the language.