Example #1
0
        public virtual async Task <IndexResponse> DeleteAsync(DeleteIndexRequest request)
        {
            Ensure.That(request, "request").IsNotNull();

            var httpRequest = DeleteIndexHttpRequestFactory.Create(request);

            using (var res = await SendAsync(httpRequest).ForAwait())
            {
                return(await IndexResponseFactory.CreateAsync(res).ForAwait());
            }
        }
Example #2
0
        public virtual async Task <IndexResponse> DeleteAsync(DeleteIndexRequest request, CancellationToken cancellationToken = default)
        {
            Ensure.Any.IsNotNull(request, nameof(request));

            var httpRequest = DeleteIndexHttpRequestFactory.Create(request);

            using (var res = await SendAsync(httpRequest, cancellationToken).ForAwait())
            {
                return(await IndexResponseFactory.CreateAsync(res).ForAwait());
            }
        }
Example #3
0
        public virtual async Task <IndexResponse> PostAsync(PostIndexRequest request)
        {
            Ensure.Any.IsNotNull(request, nameof(request));

            var httpRequest = PostIndexHttpRequestFactory.Create(request);

            using (var res = await SendAsync(httpRequest).ForAwait())
            {
                return(await IndexResponseFactory.CreateAsync(res).ForAwait());
            }
        }
Example #4
0
        public Queries(IDbConnection connection, ISerializer documentSerializer, ISerializer serializer)
            : base(connection)
        {
            Ensure.That(documentSerializer, "documentSerializer").IsNotNull();
            Ensure.That(serializer, "serializer").IsNotNull();

            PostIndexHttpRequestFactory     = new PostIndexHttpRequestFactory(serializer);
            GetAllIndexesHttpRequestFactory = new GetAllIndexesHttpRequestFactory();
            DeleteIndexHttpRequestFactory   = new DeleteIndexHttpRequestFactory();
            FindHttpRequestFactory          = new FindHttpRequestFactory(serializer);

            IndexResponseFactory     = new IndexResponseFactory(serializer);
            IndexListResponseFactory = new IndexListResponseFactory(serializer);
            FindResponseFactory      = new FindResponseFactory(documentSerializer);
        }