示例#1
0
        public IHttpClient Decorate(
            IHttpClient httpClient,
            IHttpApiConfiguration httpApiConfiguration)
        {
            var httpApiWithCircuitBreaking = httpApiConfiguration as IHttpApiWithCircuitBreaking;

            if (httpApiWithCircuitBreaking is null)
            {
                return(httpClient);
            }

            return(httpClient.AddCircuitBreaking(httpApiWithCircuitBreaking, _circuitBreakerManager));
        }