public ServiceBase(IHttpClientFactory httpClientFactory, IProvideAccessTokens accessTokenProvider, IMemoryCache cache, string clientKey) { if (httpClientFactory == null) { throw new ArgumentNullException(nameof(httpClientFactory)); } _accessTokenProvider = accessTokenProvider ?? throw new ArgumentNullException(nameof(accessTokenProvider)); _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _clientKey = clientKey; if (string.IsNullOrWhiteSpace(clientKey)) { throw new ArgumentException(nameof(clientKey)); } HttpClient = httpClientFactory.CreateClient(clientKey); }
public RestClientFactory(IMemoryCache cache, IProvideAccessTokens accessTokenProvider) { _accessTokenProvider = accessTokenProvider; _cache = cache; }
public UserServiceV1(IHttpClientFactory httpClientFactory, IProvideAccessTokens accessTokenProvider, IMemoryCache cache) : base(httpClientFactory, accessTokenProvider, cache, ClientKey) { }