public TClient CreateClient(HttpClient httpClient, string name) { if (httpClient == null) { throw new ArgumentNullException(nameof(httpClient)); } var httpClientCallInvoker = new HttpClientCallInvoker(httpClient, _loggerFactory); var options = _optionsMonitor.Get(name); for (var i = 0; i < options.CallInvokerActions.Count; i++) { options.CallInvokerActions[i](httpClientCallInvoker); } return((TClient)_cache.Activator(_services, new object[] { httpClientCallInvoker.Intercept(options.Interceptors.ToArray()) })); }