Exemple #1
0
        /// <summary>
        /// Returns the default retry policy dedicated to handling transient conditions with Npgsql commands.
        /// </summary>
        /// <returns>The retry policy for Npgsql commands with the corresponding default strategy (or the default strategy, if no retry strategy assigned to Npgsql commands was found).</returns>
        public static RetryPolicy GetDefaultNpgsqlCommandRetryPolicy(this RetryManager retryManager)
        {
            if (retryManager == null)
            {
                throw new ArgumentNullException("retryManager");
            }

            return(new RetryPolicy(new PostgreSqlDatabaseTransientErrorDetectionStrategy(), retryManager.GetDefaultNpgsqlCommandRetryStrategy()));
        }