Added GetHashCode() implementation. When overriding Equals(), this should also be implemented.
diff --git a/src/main/csharp/BaseMessage.cs b/src/main/csharp/BaseMessage.cs
index 7f99617..c2e49bc 100644
--- a/src/main/csharp/BaseMessage.cs
+++ b/src/main/csharp/BaseMessage.cs
@@ -209,6 +209,62 @@
return true;
}
+ public override int GetHashCode()
+ {
+ int hashCode = 0;
+
+ if(propertiesMap != null)
+ {
+ hashCode ^= propertiesMap.GetHashCode();
+ }
+
+ if(destination != null)
+ {
+ hashCode ^= destination.GetHashCode();
+ }
+
+ if(correlationId != null)
+ {
+ hashCode ^= correlationId.GetHashCode();
+ }
+
+ if(timeToLive != null)
+ {
+ hashCode ^= timeToLive.GetHashCode();
+ }
+
+ if(messageId != null)
+ {
+ hashCode ^= messageId.GetHashCode();
+ }
+
+ hashCode ^= deliveryMode.GetHashCode();
+ hashCode ^= priority.GetHashCode();
+
+ if(replyTo != null)
+ {
+ hashCode ^= replyTo.GetHashCode();
+ }
+
+ if(content != null)
+ {
+ hashCode ^= content.GetHashCode();
+ }
+
+ if(type != null)
+ {
+ hashCode ^= type.GetHashCode();
+ }
+
+ if(timestamp != null)
+ {
+ hashCode ^= timestamp.GetHashCode();
+ }
+
+ hashCode ^= readOnlyMsgBody.GetHashCode();
+ return hashCode;
+ }
+
public bool ReadOnlyBody
{
get { return readOnlyMsgBody; }