示例#1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is OAuthToken other &&
                   ((AccessToken == null && other.AccessToken == null) || (AccessToken?.Equals(other.AccessToken) == true)) &&
                   ((TokenType == null && other.TokenType == null) || (TokenType?.Equals(other.TokenType) == true)) &&
                   ((ExpiresIn == null && other.ExpiresIn == null) || (ExpiresIn?.Equals(other.ExpiresIn) == true)) &&
                   ((Scope == null && other.Scope == null) || (Scope?.Equals(other.Scope) == true)) &&
                   ((Expiry == null && other.Expiry == null) || (Expiry?.Equals(other.Expiry) == true)));
        }
示例#2
0
        /// <summary>
        /// Returns true if Conversation instances are equal
        /// </summary>
        /// <param name="other">Instance of Conversation to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Conversation other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ConversationId == other.ConversationId ||
                     ConversationId != null &&
                     ConversationId.Equals(other.ConversationId)
                     ) &&
                 (
                     Token == other.Token ||
                     Token != null &&
                     Token.Equals(other.Token)
                 ) &&
                 (
                     ExpiresIn == other.ExpiresIn ||
                     ExpiresIn != null &&
                     ExpiresIn.Equals(other.ExpiresIn)
                 ) &&
                 (
                     StreamUrl == other.StreamUrl ||
                     StreamUrl != null &&
                     StreamUrl.Equals(other.StreamUrl)
                 ) &&
                 (
                     ReferenceGrammarId == other.ReferenceGrammarId ||
                     ReferenceGrammarId != null &&
                     ReferenceGrammarId.Equals(other.ReferenceGrammarId)
                 ) &&
                 (
                     ETag == other.ETag ||
                     ETag != null &&
                     ETag.Equals(other.ETag)
                 ));
        }