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