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

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