<PackageReference Include="Polly" Version="2.0.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.

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

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