예제 #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 (InputAddress != null)
         {
             hashCode = hashCode * 59 + InputAddress.GetHashCode();
         }
         if (InputCoinType != null)
         {
             hashCode = hashCode * 59 + InputCoinType.GetHashCode();
         }
         if (OutputAddressNickname != null)
         {
             hashCode = hashCode * 59 + OutputAddressNickname.GetHashCode();
         }
         if (OutputCoinType != null)
         {
             hashCode = hashCode * 59 + OutputCoinType.GetHashCode();
         }
         if (RefundAddressNickname != null)
         {
             hashCode = hashCode * 59 + RefundAddressNickname.GetHashCode();
         }
         if (SessionToken != null)
         {
             hashCode = hashCode * 59 + SessionToken.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #2
0
        /// <summary>
        /// Returns true if MappingsModel1 instances are equal
        /// </summary>
        /// <param name="other">Instance of MappingsModel1 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MappingsModel1 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     InputAddress == other.InputAddress ||
                     InputAddress != null &&
                     InputAddress.Equals(other.InputAddress)
                     ) &&
                 (
                     InputCoinType == other.InputCoinType ||
                     InputCoinType != null &&
                     InputCoinType.Equals(other.InputCoinType)
                 ) &&
                 (
                     OutputAddressNickname == other.OutputAddressNickname ||
                     OutputAddressNickname != null &&
                     OutputAddressNickname.Equals(other.OutputAddressNickname)
                 ) &&
                 (
                     OutputCoinType == other.OutputCoinType ||
                     OutputCoinType != null &&
                     OutputCoinType.Equals(other.OutputCoinType)
                 ) &&
                 (
                     RefundAddressNickname == other.RefundAddressNickname ||
                     RefundAddressNickname != null &&
                     RefundAddressNickname.Equals(other.RefundAddressNickname)
                 ) &&
                 (
                     SessionToken == other.SessionToken ||
                     SessionToken != null &&
                     SessionToken.Equals(other.SessionToken)
                 ));
        }