internal static void ValidateRetryPolicyOptions(this DefaultRetryPolicyOptions retryPolicyOptions) { if (retryPolicyOptions == null) { throw new ArgumentNullException(nameof(retryPolicyOptions), $"Parameter {nameof(retryPolicyOptions)} is not specified."); } if (retryPolicyOptions.DeltaBackoff <= TimeSpan.Zero) { throw new ArgumentException($"Parameter {nameof(retryPolicyOptions.DeltaBackoff)} must be a positive timespan."); } if (retryPolicyOptions.MaxCumulativeWaitTime <= TimeSpan.Zero) { throw new ArgumentException($"Parameter {nameof(retryPolicyOptions.MaxCumulativeWaitTime)} must be a positive timespan."); } }
IOptionalDeliveryConfiguration IOptionalDeliveryConfiguration.WithDefaultRetryPolicyOptions(DefaultRetryPolicyOptions retryPolicyOptions) { retryPolicyOptions.ValidateRetryPolicyOptions(); _deliveryOptions.DefaultRetryPolicyOptions = retryPolicyOptions; return(this); }