Esempio n. 1
0
        public virtual ReplaceDocumentResponse Replace(ReplaceDocumentCommand cmd)
        {
            Ensure.That(cmd, "cmd").IsNotNull();

            return ReplaceAsync(cmd).Result;
        }
Esempio n. 2
0
        protected virtual HttpRequestMessage CreateRequest(ReplaceDocumentCommand cmd)
        {
            var req = new HttpRequest(new HttpMethod("COPY"), GenerateRequestUrl(cmd));

            req.Headers.Add("Destination", string.Concat(cmd.TrgId, "?rev=", cmd.TrgRev));

            return req;
        }
Esempio n. 3
0
 protected virtual string GenerateRequestUrl(ReplaceDocumentCommand cmd)
 {
     return GenerateDocumentRequestUrl(cmd.SrcId, cmd.SrcRev);
 }
Esempio n. 4
0
        public virtual async Task<ReplaceDocumentResponse> ReplaceAsync(ReplaceDocumentCommand cmd)
        {
            Ensure.That(cmd, "cmd").IsNotNull();

            var req = CreateRequest(cmd);
            var res = SendAsync(req);

            return await ProcessHttpReplaceDocumentResponseAsync(res);
        }