示例#1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked            // Overflow is fine, just wrap
     {
         int hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Cr != null)
         {
             hashCode = hashCode * 59 + Cr.GetHashCode();
         }
         if (Qr != null)
         {
             hashCode = hashCode * 59 + Qr.GetHashCode();
         }
         if (Car != null)
         {
             hashCode = hashCode * 59 + Car.GetHashCode();
         }
         if (Tlgr != null)
         {
             hashCode = hashCode * 59 + Tlgr.GetHashCode();
         }
         if (Dar != null)
         {
             hashCode = hashCode * 59 + Dar.GetHashCode();
         }
         if (Em != null)
         {
             hashCode = hashCode * 59 + Em.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#2
0
        /// <summary>
        /// Returns true if Solvency instances are equal
        /// </summary>
        /// <param name="other">Instance of Solvency to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Solvency other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Cr == other.Cr ||
                     Cr != null &&
                     Cr.Equals(other.Cr)
                     ) &&
                 (
                     Qr == other.Qr ||
                     Qr != null &&
                     Qr.Equals(other.Qr)
                 ) &&
                 (
                     Car == other.Car ||
                     Car != null &&
                     Car.Equals(other.Car)
                 ) &&
                 (
                     Tlgr == other.Tlgr ||
                     Tlgr != null &&
                     Tlgr.Equals(other.Tlgr)
                 ) &&
                 (
                     Dar == other.Dar ||
                     Dar != null &&
                     Dar.Equals(other.Dar)
                 ) &&
                 (
                     Em == other.Em ||
                     Em != null &&
                     Em.Equals(other.Em)
                 ));
        }