/// <summary> /// Initializes a new instance of the <see cref="SqlRetryPolicy"/> class with the specified number of retry attempts and parameters defining the progressive delay between retries. /// </summary> /// <param name="errorDetectionStrategy">The <see cref="ITransientErrorDetectionStrategy"/> that is responsible for detecting transient conditions.</param> /// <param name="retryStrategy">The strategy to use for this retry policy.</param> public SqlRetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, SqlRetryStrategy retryStrategy) { this.ErrorDetectionStrategy = errorDetectionStrategy; if (errorDetectionStrategy == null) { throw new InvalidOperationException("The error detection strategy type must implement the ITransientErrorDetectionStrategy interface."); } this.RetryStrategy = retryStrategy; }
/// <summary> /// Initializes a new instance of the <see cref="SqlRetryPolicy{T}"/> class with the specified number of retry attempts and parameters defining the progressive delay between retries. /// </summary> /// <param name="retryStrategy">The strategy to use for this retry policy.</param> public SqlRetryPolicy(SqlRetryStrategy retryStrategy) : base(new T(), retryStrategy) { }