public static IServiceCollection AddCircuitBreaker(this IServiceCollection services, ServiceLifetime serviceLifetime = ServiceLifetime.Scoped) { var builder = new CircuitBreakerOptionBuilder(); services.AddCircuitBreaker(builder, serviceLifetime); return(services); }
public static IServiceCollection AddCircuitBreaker(this IServiceCollection services, CircuitBreakerOptionBuilder circuitBreakerOptionBuilder, ServiceLifetime serviceLifetime = ServiceLifetime.Scoped) { if (circuitBreakerOptionBuilder is null) { throw new ArgumentNullException(nameof(circuitBreakerOptionBuilder)); } services.AddCircuitBreaker(circuitBreakerOptionBuilder.Build(), serviceLifetime); return(services); }