/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (MethodName != null) { hashCode = hashCode * 59 + MethodName.GetHashCode(); } if (Payload != null) { hashCode = hashCode * 59 + Payload.GetHashCode(); } if (ResponseTimeoutInSeconds != null) { hashCode = hashCode * 59 + ResponseTimeoutInSeconds.GetHashCode(); } if (ConnectTimeoutInSeconds != null) { hashCode = hashCode * 59 + ConnectTimeoutInSeconds.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if MethodInvoke instances are equal /// </summary> /// <param name="other">Instance of MethodInvoke to be compared</param> /// <returns>Boolean</returns> public bool Equals(MethodInvoke other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( MethodName == other.MethodName || MethodName != null && MethodName.Equals(other.MethodName) ) && ( Payload == other.Payload || Payload != null && Payload.Equals(other.Payload) ) && ( ResponseTimeoutInSeconds == other.ResponseTimeoutInSeconds || ResponseTimeoutInSeconds != null && ResponseTimeoutInSeconds.Equals(other.ResponseTimeoutInSeconds) ) && ( ConnectTimeoutInSeconds == other.ConnectTimeoutInSeconds || ConnectTimeoutInSeconds != null && ConnectTimeoutInSeconds.Equals(other.ConnectTimeoutInSeconds) )); }