コード例 #1
0
        private void AddDeletedDoc(BatchSet bs, BsonDocument doc, SyncLogItem logItem)
        {
            if (bs.DeletedDocuments == null)
                bs.DeletedDocuments = new List<DeletedDocument>();

            //check uploaded anchor- means cliet just uploaded this record and we should not return back
            if (logItem != null && logItem.KeyVersion != null && logItem.KeyVersion.ContainsKey(doc["o"].AsBsonDocument["_id"].AsString))
                return;

            DeletedDocument delDoc = new DeletedDocument();
            delDoc.Key = doc["o"].AsBsonDocument["_id"].AsString;
            bs.DeletedDocuments.Add(delDoc);
        }
コード例 #2
0
 private void AddDeletedDoc(BatchSet changeSet, ChangesResponse<string>.Row row, SyncLogItem logItem)
 {
     if (changeSet.DeletedDocuments == null)
         changeSet.DeletedDocuments = new List<DeletedDocument>();
     DeletedDocument delObj = new DeletedDocument() { Key = row.Id, Version = row.Changes[0].Rev };
     //check uploaded anchor- means cliet just uploaded this record and we should not return back
     if (logItem != null && logItem.KeyVersion != null && logItem.KeyVersion.ContainsKey(delObj.Key) && logItem.KeyVersion[delObj.Key] == delObj.Version)
         return;
     changeSet.DeletedDocuments.Add(delObj);
 }