Beispiel #1
0
        public Searches(IDbClientConnection connection, ISerializer documentSerializer, ISerializer serializer)
            : base(connection)
        {
            Ensure.That(documentSerializer, "documentSerializer").IsNotNull();
            Ensure.That(serializer, "serializer").IsNotNull();

            SearchIndexHttpRequestFactory = new SearchIndexHttpRequestFactory(documentSerializer, serializer);
            SearchIndexResponseFactory    = new SearchIndexResponseFactory(documentSerializer);
        }
Beispiel #2
0
        public Searches(IConnection connection, ISerializer serializer, IEntitySerializer entitySerializer)
            : base(connection)
        {
            Ensure.That(serializer, "serializer").IsNotNull();
            Ensure.That(entitySerializer, "entitySerializer").IsNotNull();

            SearchIndexHttpRequestFactory = new SearchIndexHttpRequestFactory(Connection);
            SearchIndexResponseFactory    = new SearchIndexResponseFactory(serializer, entitySerializer);
        }
Beispiel #3
0
        public virtual async Task <SearchIndexResponse <TIncludedDoc> > SearchAsync <TIncludedDoc>(SearchIndexRequest request)
        {
            Ensure.Any.IsNotNull(request, nameof(request));

            var httpRequest = SearchIndexHttpRequestFactory.Create(request);

            using (var res = await SendAsync(httpRequest).ForAwait())
            {
                return(await SearchIndexResponseFactory.CreateAsync <TIncludedDoc>(res).ForAwait());
            }
        }
Beispiel #4
0
        public virtual async Task <SearchIndexResponse> SearchAsync(SearchIndexRequest request)
        {
            Ensure.That(request, "request").IsNotNull();

            var httpRequest = SearchIndexHttpRequestFactory.Create(request);

            using (var res = await SendAsync(httpRequest).ForAwait())
            {
                return(await SearchIndexResponseFactory.CreateAsync(res).ForAwait());
            }
        }
Beispiel #5
0
 protected virtual HttpRequest CreateHttpRequest(SearchIndexRequest request)
 {
     return(SearchIndexHttpRequestFactory.Create(request));
 }