/// <summary> /// Returns true if AvailabilityMetricsDowntime instances are equal /// </summary> /// <param name="other">Instance of AvailabilityMetricsDowntime to be compared</param> /// <returns>Boolean</returns> public bool Equals(AvailabilityMetricsDowntime other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( GeneralDowntime == other.GeneralDowntime || GeneralDowntime != null && GeneralDowntime.Equals(other.GeneralDowntime) ) && ( ScheduledOutage == other.ScheduledOutage || ScheduledOutage != null && ScheduledOutage.Equals(other.ScheduledOutage) ) && ( Endpoints == other.Endpoints || Endpoints != null && Endpoints.Equals(other.Endpoints) )); }
/// <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 (GeneralDowntime != null) { hashCode = hashCode * 59 + GeneralDowntime.GetHashCode(); } if (ScheduledOutage != null) { hashCode = hashCode * 59 + ScheduledOutage.GetHashCode(); } if (Endpoints != null) { hashCode = hashCode * 59 + Endpoints.GetHashCode(); } return(hashCode); } }