<PackageReference Include="Polly" Version="4.1.0" />

Policy

public class Policy
Transient exception handling policies that can be applied to delegates
public static PolicyBuilder Handle<TException>() where TException : Exception

Specifies the type of exception that this policy can handle.

public static PolicyBuilder Handle<TException>(Func<TException, bool> exceptionPredicate) where TException : Exception

Specifies the type of exception that this policy can handle with addition filters on this exception type.

public void Execute(Action action)

Executes the specified action within the policy.

protected void Execute(Action action, Context context)

Executes the specified action within the policy.

protected TResult Execute<TResult>(Func<TResult> action, Context context)

Executes the specified action within the policy and returns the result.

public TResult Execute<TResult>(Func<TResult> action)

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<TResult>(Func<TResult> action)

Executes the specified action within the policy and returns the captured result