Ejemplo n.º 1
0
        public override bool Equals(object @object)
        {
            if (@object == this)
            {
                return(true);
            }
            if (!(@object is Couchbase.Lite.QueryRow))
            {
                return(false);
            }
            Couchbase.Lite.QueryRow other = (Couchbase.Lite.QueryRow)@object;
            bool documentPropertiesEqual  = Utils.IsEqual(documentProperties, other.GetDocumentProperties
                                                              ());

            if (database == other.database && Utils.IsEqual(key, other.GetKey()) && Utils.IsEqual
                    (sourceDocumentId, other.GetSourceDocumentId()) && documentPropertiesEqual)
            {
                // If values were emitted, compare them. Otherwise we have nothing to go on so check
                // if _anything_ about the doc has changed (i.e. the sequences are different.)
                if (value != null || other.GetValue() != null)
                {
                    return(value.Equals(other.GetValue()));
                }
                else
                {
                    return(sequence == other.sequence);
                }
            }
            return(false);
        }