public CustomHttpSourceResourceProvider( IHttpCacheUtility httpCacheUtility, IConcurrencyUtility concurrencyUtility) : base( typeof(HttpSourceResource), nameof(CustomHttpSourceResourceProvider), nameof(HttpSourceResource)) { _httpCacheUtility = httpCacheUtility ?? throw new ArgumentNullException(nameof(httpCacheUtility)); _concurrencyUtility = concurrencyUtility ?? throw new ArgumentNullException(nameof(concurrencyUtility)); }
public static SourceRepository GetCustomRepository( this Repository.RepositoryFactory factory, IHttpCacheUtility httpCacheUtility, IConcurrencyUtility concurrencyUtility) { var providers = Repository .Provider .GetCoreV3() .Concat(new[] { new Lazy <INuGetResourceProvider>(() => new CustomHttpHandlerResourceProvider()), new Lazy <INuGetResourceProvider>(() => new CustomHttpSourceResourceProvider( httpCacheUtility, concurrencyUtility)) }); return(Repository.CreateSource(providers, "https://api.nuget.org/v3/index.json")); }