Exemple #1
0
        /// <summary>
        /// Returns true if APIKeyBase instances are equal
        /// </summary>
        /// <param name="input">Instance of APIKeyBase to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(APIKeyBase input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     RetCode == input.RetCode ||
                     (RetCode != null &&
                      RetCode.Equals(input.RetCode))
                     ) &&
                 (
                     RetMsg == input.RetMsg ||
                     (RetMsg != null &&
                      RetMsg.Equals(input.RetMsg))
                 ) &&
                 (
                     ExtCode == input.ExtCode ||
                     (ExtCode != null &&
                      ExtCode.Equals(input.ExtCode))
                 ) &&
                 (
                     ExtInfo == input.ExtInfo ||
                     (ExtInfo != null &&
                      ExtInfo.Equals(input.ExtInfo))
                 ) &&
                 (
                     Result == input.Result ||
                     Result != null &&
                     Result.SequenceEqual(input.Result)
                 ) &&
                 (
                     TimeNow == input.TimeNow ||
                     (TimeNow != null &&
                      TimeNow.Equals(input.TimeNow))
                 ));
        }
Exemple #2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (RetCode != null)
                {
                    hashCode = hashCode * 59 + RetCode.GetHashCode();
                }

                if (RetMsg != null)
                {
                    hashCode = hashCode * 59 + RetMsg.GetHashCode();
                }

                if (ExtCode != null)
                {
                    hashCode = hashCode * 59 + ExtCode.GetHashCode();
                }

                if (ExtInfo != null)
                {
                    hashCode = hashCode * 59 + ExtInfo.GetHashCode();
                }

                if (Result != null)
                {
                    hashCode = hashCode * 59 + Result.GetHashCode();
                }

                if (TimeNow != null)
                {
                    hashCode = hashCode * 59 + TimeNow.GetHashCode();
                }

                return(hashCode);
            }
        }