コード例 #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 (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (MiName != null)
         {
             hashCode = hashCode * 59 + MiName.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Gosnum != null)
         {
             hashCode = hashCode * 59 + Gosnum.GetHashCode();
         }
         if (Interval != null)
         {
             hashCode = hashCode * 59 + Interval.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if MIType instances are equal
        /// </summary>
        /// <param name="other">Instance of MIType to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MIType other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     MiName == other.MiName ||
                     MiName != null &&
                     MiName.Equals(other.MiName)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Gosnum == other.Gosnum ||
                     Gosnum != null &&
                     Gosnum.Equals(other.Gosnum)
                 ) &&
                 (
                     Interval == other.Interval ||
                     Interval != null &&
                     Interval.Equals(other.Interval)
                 ));
        }