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

AsyncFallbackSyntax

public static class AsyncFallbackSyntax
Fluent API for defining a Fallback AsyncPolicy.
public static AsyncFallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<CancellationToken, Task> fallbackAction)

Builds an AsyncFallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, asynchronously calls fallbackAction.

public static AsyncFallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<CancellationToken, Task> fallbackAction, Func<Exception, Task> onFallbackAsync)

Builds an AsyncFallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls onFallbackAsync with details of the handled exception; then asynchronously calls fallbackAction.

public static AsyncFallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<Context, CancellationToken, Task> fallbackAction, Func<Exception, Context, Task> onFallbackAsync)

Builds an AsyncFallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls onFallbackAsync with details of the handled exception and execution context; then asynchronously calls fallbackAction.

public static AsyncFallbackPolicy FallbackAsync(this PolicyBuilder policyBuilder, Func<Exception, Context, CancellationToken, Task> fallbackAction, Func<Exception, Context, Task> onFallbackAsync)

Builds an AsyncFallbackPolicy which provides a fallback action if the main execution fails. Executes the main delegate asynchronously, but if this throws a handled exception, first asynchronously calls onFallbackAsync with details of the handled exception and execution context; then asynchronously calls fallbackAction.