Пример #1
0
        /// <inheritdoc/>
        public virtual async Task <HttpResponseMessage> GetSearchResponseMessageAsync(int count = 0, OutputMode outputMode = OutputMode.Xml)
        {
            var args = new SearchResultArgs {
                Count = count
            };

            return(await this.GetSearchResponseMessageAsync(args, outputMode));
        }
Пример #2
0
        /// <inheritdoc/>
        public virtual async Task <SearchResultStream> GetSearchPreviewAsync(int count = 0)
        {
            var args = new SearchResultArgs {
                Count = count
            };
            var searchResults = await this.GetSearchPreviewAsync(args);

            return(searchResults);
        }
Пример #3
0
        /// <inheritdoc/>
        public virtual async Task<HttpResponseMessage> GetSearchResponseMessageAsync(SearchResultArgs args, OutputMode outputMode = OutputMode.Xml)
        {
            await this.TransitionAsync(DispatchState.Done).ConfigureAwait(false);

            var resourceName = new ResourceName(this.ResourceName, "results");
            var requestArgs = args.AsEnumerable().Concat(new SearchResponseMessageArgs { OutputMode = outputMode });
            var message = await this.Context.GetHttpResponseMessageAsync(this.Namespace, resourceName, requestArgs).ConfigureAwait(false);

            try
            {
                message.EnsureSuccessStatusCode();
            }
            catch
            {
                message.Dispose();
                throw;
            }

            return message;
        }
Пример #4
0
        /// <inheritdoc/>
        public virtual async Task <SearchResultStream> GetSearchPreviewAsync(SearchResultArgs args)
        {
            var searchResults = await this.GetSearchResultsAsync(DispatchState.Running, "results_preview", args).ConfigureAwait(false);

            return(searchResults);
        }
Пример #5
0
 public abstract Task <SearchResultStream> GetSearchResultsAsync(SearchResultArgs args);
Пример #6
0
 public abstract Task <HttpResponseMessage> GetSearchResponseMessageAsync(SearchResultArgs args, OutputMode outputMode = OutputMode.Xml);
Пример #7
0
 /// <inheritdoc/>
 public virtual async Task<SearchResultStream> GetSearchResultsAsync(SearchResultArgs args)
 {
     var searchResults = await this.GetSearchResultsAsync(DispatchState.Done, "results", args).ConfigureAwait(false);
     return searchResults;
 }