コード例 #1
0
 public Task <SearchResultStream> ExportSearchResultsAsync(string search, SearchExportArgs args = null)
 {
     Contract.Requires <ArgumentNullException>(search != null);
     return(default(Task <SearchResultStream>));
 }
コード例 #2
0
        /// <inheritdoc/>
        public virtual async Task <SearchResultStream> ExportSearchResultsAsync(string search, SearchExportArgs args = null)
        {
            var arguments = new Argument[]
            {
                new Argument("search", search)
            }
            .AsEnumerable();

            if (args != null)
            {
                arguments = arguments.Concat(args);
            }

            var response = await this.Context.GetAsync(this.Namespace, SearchJobsExport, arguments).ConfigureAwait(false);

            try
            {
                await response.EnsureStatusCodeAsync(HttpStatusCode.OK).ConfigureAwait(false);

                return(await SearchResultStream.CreateAsync(response).ConfigureAwait(false)); // Transfers response ownership
            }
            catch
            {
                response.Dispose();
                throw;
            }
        }