예제 #1
0
        /// <summary>
        /// Search for packages. Includes prerelease packages.
        /// </summary>
        /// <param name="query">The search query.</param>
        /// <param name="cancellationToken">A token to cancel the task.</param>
        /// <returns>The search results, including prerelease packages.</returns>
        public async Task <SearchResponse> SearchAsync(string query, CancellationToken cancellationToken = default)
        {
            var request = new SearchRequest
            {
                Query             = query,
                Skip              = 0,
                Take              = 20,
                IncludePrerelease = true,
                IncludeSemVer2    = true,
            };

            var client = await _clientFactory.CreateSearchClientAsync(cancellationToken);

            return(await client.SearchAsync(request, cancellationToken));
        }
예제 #2
0
        /// <summary>
        /// Search for packages. Includes prerelease packages.
        /// </summary>
        /// <param name="query">The search query.</param>
        /// <param name="cancellationToken">A token to cancel the task.</param>
        /// <returns>The search results, including prerelease packages.</returns>
        public async Task <SearchResponse> SearchAsync(string query, CancellationToken cancellationToken = default)
        {
            var client = await _clientFactory.CreateSearchClientAsync(cancellationToken);

            return(await client.SearchAsync(query, cancellationToken : cancellationToken));
        }