/// <inheritdoc /> /// <summary> /// Create with retry strategy, 20ms delay, general aspect and asynchronous general aspect. /// </summary> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> protected WithAspectAndRetryAsync( IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync) : this(TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, generalAspectAsync, null, null) { }
/// <summary> /// Create with general, before and after aspect. /// </summary> /// <param name="generalAspect"></param> /// <param name="before"></param> /// <param name="after"></param> protected WithAspect(IGeneralAspect generalAspect, IReadOnlyList <IBeforeAspect <TInput, TOutput> > before, IReadOnlyList <IAfterAspect <TInput, TOutput> > after) { _generalAspect = generalAspect; _before = before; _after = after; }
/// <inheritdoc /> /// <summary> /// Create with retry strategy, 20ms delay, general aspect and asynchronous before aspect. /// </summary> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="beforeAsync"></param> protected WithAspectAndRetryAsync( IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, null, beforeAsync, null) { }
/// <inheritdoc /> /// <summary> /// Create with retry strategy, delay and general aspect. /// </summary> /// <param name="retryStrategy"></param> /// <param name="delay"></param> /// <param name="generalAspect"></param> protected WithAspectAndRetryAsync( IRetryStrategy retryStrategy, int delay, IGeneralAspect generalAspect) : this(TimeSpan.FromMilliseconds(delay), retryStrategy, generalAspect, null, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, general aspect and asynchronous before aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="generalAspect"></param> /// <param name="beforeAsync"></param> protected WithAspectAndErrorHandlerAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IGeneralAspect generalAspect, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(errorHandlerStrategy, generalAspect, null, beforeAsync, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, general aspect and asynchronous general aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> protected WithAspectAndErrorHandlerAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync) : this(errorHandlerStrategy, generalAspect, generalAspectAsync, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, retry strategy, 20ms delay and general aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> protected WithSaga( IErrorHandlerStrategy errorHandlerStrategy, IRetryStrategy retryStrategy, IGeneralAspect generalAspect) : this(errorHandlerStrategy, TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, retry strategy, delay and general aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="retryStrategy"></param> /// <param name="delay"></param> /// <param name="generalAspect"></param> protected WithSagaAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IRetryStrategy retryStrategy, int delay, IGeneralAspect generalAspect) : this(errorHandlerStrategy, TimeSpan.FromMilliseconds(delay), retryStrategy, generalAspect, null, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, retry strategy, 20ms delay, general aspect, asynchronous general aspect and asynchronous before aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> protected WithSagaAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(errorHandlerStrategy, TimeSpan.FromMilliseconds(Constant.DefaultDelay), retryStrategy, generalAspect, generalAspectAsync, beforeAsync, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, general aspect, asynchronous general aspect, asynchronous before and after aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> /// <param name="afterAsync"></param> protected WithAspectAndErrorHandlerAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync, IReadOnlyList <IAfterAspectAsync <TInput, TOutput> > afterAsync) : base(generalAspect, generalAspectAsync, beforeAsync, afterAsync) { _errorHandlerStrategy = errorHandlerStrategy ?? throw new ArgumentNullException("Error handler strategy cannot be null."); }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, delay, retry strategy, general, before and after aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="delay"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="before"></param> /// <param name="after"></param> protected WithSaga( IErrorHandlerStrategy errorHandlerStrategy, TimeSpan delay, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IReadOnlyList <IBeforeAspect <TInput, TOutput> > before, IReadOnlyList <IAfterAspect <TInput, TOutput> > after) : base(delay, retryStrategy, generalAspect, before, after) { _errorHandlerStrategy = errorHandlerStrategy; }
/// <inheritdoc /> /// <summary> /// Create with delay, retry strategy, general, before and after aspect. /// </summary> /// <param name="delay"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="before"></param> /// <param name="after"></param> protected WithAspectAndRetry( TimeSpan delay, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IReadOnlyList <IBeforeAspect <TInput, TOutput> > before, IReadOnlyList <IAfterAspect <TInput, TOutput> > after) : base(generalAspect, before, after) { _retryStrategy = retryStrategy; _delayMiliseconds = (int)delay.TotalMilliseconds; }
/// <summary> /// Create with general aspect, asynchronous general aspect, asynchronous before and after aspect. /// </summary> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> /// <param name="afterAsync"></param> protected WithAspectAsync( IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync, IReadOnlyList <IAfterAspectAsync <TInput, TOutput> > afterAsync) { _generalAspect = generalAspect; _generalAspectAsync = generalAspectAsync; _beforeAsync = beforeAsync; _afterAsync = afterAsync; }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy, delay, retry strategy, general aspect, asynchronous aspect, asynchronous before and after aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="delay"></param> /// <param name="retryStrategy"></param> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> /// <param name="afterAsync"></param> protected WithSagaAsync( IErrorHandlerStrategyAsync errorHandlerStrategy, TimeSpan delay, IRetryStrategy retryStrategy, IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync, IReadOnlyList <IAfterAspectAsync <TInput, TOutput> > afterAsync) : base(delay, retryStrategy, generalAspect, generalAspectAsync, beforeAsync, afterAsync) { _errorHandlerStrategy = errorHandlerStrategy; }
/// <summary> /// Create with general aspect and asynchronous general aspect. /// </summary> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> protected WithAspectAsync(IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync) : this(generalAspect, generalAspectAsync, null) { }
/// <summary> /// Create with general aspect, asynchronous general aspect and asynchronous before aspect. /// </summary> /// <param name="generalAspect"></param> /// <param name="generalAspectAsync"></param> /// <param name="beforeAsync"></param> protected WithAspectAsync(IGeneralAspect generalAspect, IGeneralAspectAsync generalAspectAsync, IReadOnlyList <IBeforeAspectAsync <TInput, TOutput> > beforeAsync) : this(generalAspect, generalAspectAsync, beforeAsync, null) { }
/// <inheritdoc /> /// <summary> /// Create with general aspect. /// </summary> /// <param name="generalAspect"></param> protected WithAspect(IGeneralAspect generalAspect) : this(generalAspect, null, null) { }
/// <inheritdoc /> /// <summary> /// Create with error handler strategy and general aspect. /// </summary> /// <param name="errorHandlerStrategy"></param> /// <param name="generalAspect"></param> protected WithAspectAndErrorHandler(IErrorHandlerStrategy errorHandlerStrategy, IGeneralAspect generalAspect) : this(errorHandlerStrategy, generalAspect, null, null) { }