Example #1
0
        /// <summary>
        /// Returns true if HealthInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of HealthInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(HealthInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                     ) &&
                 (
                     Version == other.Version ||
                     Version != null &&
                     Version.Equals(other.Version)
                 ) &&
                 (
                     ReleaseID == other.ReleaseID ||
                     ReleaseID != null &&
                     ReleaseID.Equals(other.ReleaseID)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Debug == other.Debug ||
                     Debug != null &&
                     Debug.Equals(other.Debug)
                 ) &&
                 (
                     DebugHostInfo == other.DebugHostInfo ||
                     DebugHostInfo != null &&
                     DebugHostInfo.Equals(other.DebugHostInfo)
                 ) &&
                 (
                     DebugNodeInfo == other.DebugNodeInfo ||
                     DebugNodeInfo != null &&
                     DebugNodeInfo.Equals(other.DebugNodeInfo)
                 ) &&
                 (
                     DebugRuntimeInfo == other.DebugRuntimeInfo ||
                     DebugRuntimeInfo != null &&
                     DebugRuntimeInfo.Equals(other.DebugRuntimeInfo)
                 ) &&
                 (
                     DebugMongoInfo == other.DebugMongoInfo ||
                     DebugMongoInfo != null &&
                     DebugMongoInfo.Equals(other.DebugMongoInfo)
                 ));
        }
Example #2
0
 /// <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 (Status != null)
         {
             hashCode = hashCode * 59 + Status.GetHashCode();
         }
         if (Version != null)
         {
             hashCode = hashCode * 59 + Version.GetHashCode();
         }
         if (ReleaseID != null)
         {
             hashCode = hashCode * 59 + ReleaseID.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Debug != null)
         {
             hashCode = hashCode * 59 + Debug.GetHashCode();
         }
         if (DebugHostInfo != null)
         {
             hashCode = hashCode * 59 + DebugHostInfo.GetHashCode();
         }
         if (DebugNodeInfo != null)
         {
             hashCode = hashCode * 59 + DebugNodeInfo.GetHashCode();
         }
         if (DebugRuntimeInfo != null)
         {
             hashCode = hashCode * 59 + DebugRuntimeInfo.GetHashCode();
         }
         if (DebugMongoInfo != null)
         {
             hashCode = hashCode * 59 + DebugMongoInfo.GetHashCode();
         }
         return(hashCode);
     }
 }