Policy<TResult>
Transient fault handling policies that can be applied to delegates returning results of type TResult.
Initializes a new instance of the Policy<T> class.
Specifies the type of exception that this policy can handle.
public static PolicyBuilder<TResult> Handle<TException>(Func<TException, bool> exceptionPredicate) where TException : Exception
Specifies the type of exception that this policy can handle with additional filters on this exception type.
Specifies the type of exception that this policy can handle if found as an InnerException of a regular Exception, or at any level of nesting within an AggregateException.
public static PolicyBuilder<TResult> HandleInner<TException>(Func<TException, bool> exceptionPredicate) where TException : Exception
Specifies the type of exception that this policy can handle, with additional filters on this exception type, if found as an InnerException of a regular Exception, or at any level of nesting within an AggregateException.
Specifies a filter on the return result values that this strongly-typed generic policy will handle.
Specifies a return result value which the strongly-typed generic policy will handle.
Executes the specified action within the policy and returns the Result.
Executes the specified action within the policy and returns the result.
Executes the specified action within the policy and returns the result.
public TResult Execute(Func<CancellationToken, TResult> action, CancellationToken cancellationToken)
Executes the specified action within the policy and returns the result.
public TResult Execute(Func<Context, CancellationToken, TResult> action, IDictionary<string, object> contextData, CancellationToken cancellationToken)
Executes the specified action within the policy and returns the result.
public TResult Execute(Func<Context, CancellationToken, TResult> action, Context context, CancellationToken cancellationToken)
Executes the specified action within the policy and returns the result.
Executes the specified action within the policy and returns the captured result.
public PolicyResult<TResult> ExecuteAndCapture(Func<Context, TResult> action, IDictionary<string, object> contextData)
Executes the specified action within the policy and returns the captured result.
Executes the specified action within the policy and returns the captured result.
public PolicyResult<TResult> ExecuteAndCapture(Func<CancellationToken, TResult> action, CancellationToken cancellationToken)
Executes the specified action within the policy and returns the captured result.
public PolicyResult<TResult> ExecuteAndCapture(Func<Context, CancellationToken, TResult> action, IDictionary<string, object> contextData, CancellationToken cancellationToken)
Executes the specified action within the policy and returns the captured result.
public PolicyResult<TResult> ExecuteAndCapture(Func<Context, CancellationToken, TResult> action, Context context, CancellationToken cancellationToken)
Executes the specified action within the policy and returns the captured result.
protected abstract TResult Implementation(Func<Context, CancellationToken, TResult> action, Context context, CancellationToken cancellationToken)
Defines the implementation of a policy for synchronous executions returning TResult.
Sets the PolicyKey for this Policy<T> instance.
Must be called before the policy is first used. Can only be set once.
Wraps the specified inner policy.
Wraps the specified inner policy.