public static ICqrsBusBuilder AddRetry(this ICqrsBusBuilder builder, AsyncRetryPolicy policy)
 {
     return(builder
            .AddSingleton <ICqrsRetryOptions>(new CqrsRetryOptions(policy))
            .UseCommandDecorator(typeof(RetryCommandHandlerDecorator <>))
            .UseEventDecorator(typeof(RetryEventHandlerDecorator <>))
            .UseQueryDecorator(typeof(RetryQueryHandlerDecorator <,>)));
 }
 public static ICqrsBusBuilder AddLogging(this ICqrsBusBuilder builder, ILoggerFactory loggerFactory)
 {
     return(builder
            .AddSingleton(loggerFactory)
            .UseQueryDecorator(typeof(LoggingQueryHandlerDecorator <,>))
            .UseCommandDecorator(typeof(LoggingCommandHandlerDecorator <>))
            .UseEventDecorator(typeof(LoggingEventHandlerDecorator <>)));
 }
 public static ICqrsBusBuilder AddRetry(this ICqrsBusBuilder builder)
 {
     return(builder.AddRetry(DefaultRetryPolicy));
 }