public static ICqrsOptionsBuilder AddRetry(this ICqrsOptionsBuilder builder, AsyncRetryPolicy policy)
 {
     return(builder
            .AddSingleton <ICqrsRetryOptions>(new CqrsRetryOptions(policy))
            .UseCommandDecorator(typeof(RetryCommandHandlerDecorator <>))
            .UseEventDecorator(typeof(RetryEventHandlerDecorator <>))
            .UseQueryDecorator(typeof(RetryQueryHandlerDecorator <,>)));
 }
Ejemplo n.º 2
0
 public ICqrsBusBuilder AddSingleton <TService>(TService instance)
     where TService : class
 {
     _optionsBuilder.AddSingleton(instance);
     return(this);
 }