示例#1
0
        public virtual async Task <DocumentHeaderResponse> HeadAsync(HeadDocumentRequest request, CancellationToken cancellationToken = default)
        {
            var httpRequest = HeadDocumentHttpRequestFactory.Create(request);

            using (var res = await SendAsync(httpRequest, cancellationToken).ForAwait())
            {
                return(await DocumentHeaderReponseFactory.CreateAsync(res).ForAwait());
            }
        }
示例#2
0
        public Documents(IDbClientConnection connection, ISerializer serializer)
            : base(connection)
        {
            Ensure.That(serializer, "serializer").IsNotNull();

            Serializer                        = serializer;
            BulkHttpRequestFactory            = new BulkHttpRequestFactory();
            CopyDocumentHttpRequestFactory    = new CopyDocumentHttpRequestFactory();
            ReplaceDocumentHttpRequestFactory = new ReplaceDocumentHttpRequestFactory();
            HeadDocumentHttpRequestFactory    = new HeadDocumentHttpRequestFactory();
            GetDocumentHttpRequestFactory     = new GetDocumentHttpRequestFactory();
            PostDocumentHttpRequestFactory    = new PostDocumentHttpRequestFactory();
            PutDocumentHttpRequestFactory     = new PutDocumentHttpRequestFactory();
            DeleteDocumentHttpRequestFactory  = new DeleteDocumentHttpRequestFactory();

            DocumentReponseFactory       = new DocumentResponseFactory(Serializer);
            DocumentHeaderReponseFactory = new DocumentHeaderResponseFactory(Serializer);
            BulkReponseFactory           = new BulkResponseFactory(Serializer);
        }
示例#3
0
        public Documents(IDbConnection connection, ISerializer serializer)
            : base(connection)
        {
            Ensure.Any.IsNotNull(serializer, nameof(serializer));

            Serializer                        = serializer;
            BulkHttpRequestFactory            = new BulkHttpRequestFactory();
            CopyDocumentHttpRequestFactory    = new CopyDocumentHttpRequestFactory();
            ReplaceDocumentHttpRequestFactory = new ReplaceDocumentHttpRequestFactory();
            HeadDocumentHttpRequestFactory    = new HeadDocumentHttpRequestFactory();
            GetDocumentHttpRequestFactory     = new GetDocumentHttpRequestFactory();
            PostDocumentHttpRequestFactory    = new PostDocumentHttpRequestFactory();
            PutDocumentHttpRequestFactory     = new PutDocumentHttpRequestFactory();
            DeleteDocumentHttpRequestFactory  = new DeleteDocumentHttpRequestFactory();
            QueryShowHttpRequestFactory       = new QueryShowHttpRequestFactory(Serializer);

            DocumentReponseFactory       = new DocumentResponseFactory(Serializer);
            DocumentHeaderReponseFactory = new DocumentHeaderResponseFactory(Serializer);
            BulkReponseFactory           = new BulkResponseFactory(Serializer);
            RawResponseFactory           = new RawResponseFactory(Serializer);
        }
示例#4
0
 protected virtual HttpRequest CreateHttpRequest(HeadDocumentRequest request)
 {
     return(HeadDocumentHttpRequestFactory.Create(request));
 }