public JObject GetChanges(object document, out DocumentContainer container, out JObject jObject) { container = containerByInstance[document]; jObject = JObject.FromObject(document, new DocumentSerializer(db).CreateJsonSerializer()); JObject changedObject = new JObject(); CreateChangedDocument(container.Document, jObject, ref changedObject); return(changedObject); }
DocumentContainer CreateContainer(JObject jObject, IDocumentIdentifierResult identifiers) { DocumentContainer container = new DocumentContainer(); if (string.IsNullOrEmpty(identifiers.Id)) { return(null); } container.Id = identifiers.Id; container.Key = identifiers.Key; container.Rev = identifiers.Rev; container.Document = jObject; return(container); }
public JObject GetChanges(object document,out DocumentContainer container,out JObject jObject) { container = containerByInstance[document]; jObject = JObject.FromObject(document,new DocumentSerializer(db).CreateJsonSerializer()); JObject changedObject = new JObject(); CreateChangedDocument(container.Document, jObject, ref changedObject); return changedObject; }
DocumentContainer CreateContainer(JObject jObject, IDocumentIdentifierResult identifiers) { DocumentContainer container = new DocumentContainer(); if (string.IsNullOrEmpty(identifiers.Id)) return null; container.Id = identifiers.Id; container.Key = identifiers.Key; container.Rev = identifiers.Rev; container.Document = jObject; return container; }
DocumentContainer CreateContainer(JObject jObject) { DocumentContainer container = new DocumentContainer(); container.Id = jObject.Value<string>("_id"); if (container.Id == null) return null; container.Key = jObject.Value<string>("_key"); if (container.Key == null) return null; container.Rev = jObject.Value<string>("_rev"); if (container.Rev == null) return null; container.From = jObject.Value<string>("_from"); container.To = jObject.Value<string>("_to"); container.Document = jObject; return container; }
DocumentContainer CreateContainer(JObject jObject, DocumentIdentifierResult identifiers) { DocumentContainer container = new DocumentContainer(); if (identifiers.Error) return null; container.Id = identifiers.Id; container.Key = identifiers.Key; container.Rev = identifiers.Rev; container.Document = jObject; return container; }