コード例 #1
0
        /// <summary>
        /// Configure the NuGet client.
        /// </summary>
        /// <param name="serviceIndexUrl">The NuGet Service Index resource URL.</param>
        public NuGetClient(string serviceIndexUrl)
        {
            var httpClient = new HttpClient(new HttpClientHandler
            {
                AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
            });

            _clientFactory = new NuGetClientFactory(httpClient, serviceIndexUrl);
        }
コード例 #2
0
 /// <summary>
 /// Configure the NuGet client.
 /// </summary>
 /// <param name="clientFactory">The factory to create NuGet clients.</param>
 public NuGetClient(INuGetClientFactory clientFactory)
 {
     _clientFactory = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
 }