/// <summary> /// Read a CouchDocument or ICouchDocument, this relies on the document to obviously have an id. /// We also check the revision so that we can avoid parsing JSON if the document is unchanged. /// </summary> /// <param name="document">Document to fill.</param> public void ReadDocumentIfChanged(IBigDbDocument document) { var result = Request(document.Id).Etag(document.Rev).Parse(); if (result == null) { return; } document.ReadJson(result); }
/// <summary> /// Read a ICouchDocument with an id even if it has not changed revision. /// </summary> /// <param name="document">Document to fill.</param> public void ReadDocument(IBigDbDocument document) { document.ReadJson(ReadDocumentJObject(document.Id)); }