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()); } }
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); }
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); }
protected virtual HttpRequest CreateHttpRequest(HeadDocumentRequest request) { return(HeadDocumentHttpRequestFactory.Create(request)); }