public async Task <SearchResponse <T> > SearchAsync <T>(Action <IZendeskQuery> builder, PagerParameters pager = null) where T : ISearchResult { var query = new ZendeskQuery(); builder(query); query.WithTypeFilter <T>(); using (_loggerScope(_logger, "SearchAsync")) using (var client = _apiClient.CreateClient()) { var response = await client.GetAsync($"{SearchUri}?{query.BuildQuery()}", pager).ConfigureAwait(false); return(await response.Content.ReadAsAsync <SearchResponse <T> >()); } }
public async Task <SearchResponse <T> > SearchAsync <T>( Action <IZendeskQuery> builder, PagerParameters pager = null, CancellationToken cancellationToken = default(CancellationToken)) where T : ISearchResult { var query = new ZendeskQuery(); builder(query); query.WithTypeFilter <T>(); return(await GetAsync <SearchResponse <T> >( $"{SearchUri}?{query.BuildQuery()}", "list-search-results", "SearchAsync", pager, cancellationToken : cancellationToken)); }