public static Task Run(this IRetryPolicy retryPolicy, Func <Task> operation)
        {
            if (retryPolicy == null)
            {
                throw new ArgumentNullException(nameof(retryPolicy));
            }

            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            return(retryPolicy.Run(
                       cancellationToken => operation.Invoke(),
                       CancellationToken.None));
        }
        public static Task <TResult> Run <TResult, T>(
            this IRetryPolicy <TResult> retryPolicy,
            Func <T, Task <TResult> > operation,
            T arg)
        {
            if (retryPolicy == null)
            {
                throw new ArgumentNullException(nameof(retryPolicy));
            }

            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            return(retryPolicy.Run(
                       MakeWrapper(operation),
                       arg,
                       CancellationToken.None));
        }