예제 #1
0
        /// <summary>
        /// Returns true if InputCredentialsAuthorize instances are equal
        /// </summary>
        /// <param name="other">Instance of InputCredentialsAuthorize to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputCredentialsAuthorize other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CredentialID == other.CredentialID ||
                     CredentialID != null &&
                     CredentialID.Equals(other.CredentialID)
                     ) &&
                 (
                     NumSignatures == other.NumSignatures ||
                     NumSignatures != null &&
                     NumSignatures.Equals(other.NumSignatures)
                 ) &&
                 (
                     Hash == other.Hash ||
                     Hash != null &&
                     Hash.Equals(other.Hash)
                 ) &&
                 (
                     PIN == other.PIN ||
                     PIN != null &&
                     PIN.Equals(other.PIN)
                 ) &&
                 (
                     OTP == other.OTP ||
                     OTP != null &&
                     OTP.Equals(other.OTP)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
예제 #2
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 (CredentialID != null)
         {
             hashCode = hashCode * 59 + CredentialID.GetHashCode();
         }
         if (NumSignatures != null)
         {
             hashCode = hashCode * 59 + NumSignatures.GetHashCode();
         }
         if (Hash != null)
         {
             hashCode = hashCode * 59 + Hash.GetHashCode();
         }
         if (PIN != null)
         {
             hashCode = hashCode * 59 + PIN.GetHashCode();
         }
         if (OTP != null)
         {
             hashCode = hashCode * 59 + OTP.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (ClientData != null)
         {
             hashCode = hashCode * 59 + ClientData.GetHashCode();
         }
         return(hashCode);
     }
 }