Exemplo n.º 1
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 (OutageTime != null)
         {
             hashCode = hashCode * 59 + OutageTime.GetHashCode();
         }
         if (Duration != null)
         {
             hashCode = hashCode * 59 + Duration.GetHashCode();
         }
         if (IsPartial != null)
         {
             hashCode = hashCode * 59 + IsPartial.GetHashCode();
         }
         if (Explanation != null)
         {
             hashCode = hashCode * 59 + Explanation.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if ResponseDiscoveryOutageListData instances are equal
        /// </summary>
        /// <param name="other">Instance of ResponseDiscoveryOutageListData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ResponseDiscoveryOutageListData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     OutageTime == other.OutageTime ||
                     OutageTime != null &&
                     OutageTime.Equals(other.OutageTime)
                     ) &&
                 (
                     Duration == other.Duration ||
                     Duration != null &&
                     Duration.Equals(other.Duration)
                 ) &&
                 (
                     IsPartial == other.IsPartial ||
                     IsPartial != null &&
                     IsPartial.Equals(other.IsPartial)
                 ) &&
                 (
                     Explanation == other.Explanation ||
                     Explanation != null &&
                     Explanation.Equals(other.Explanation)
                 ));
        }