FallbackTResultSyntax
Fluent API for defining a Fallback Policy.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, TResult fallbackValue)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, returns fallbackValue instead.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, Func<TResult> fallbackAction)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, calls fallbackAction and returns its result.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, Func<CancellationToken, TResult> fallbackAction)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, calls fallbackAction and returns its result.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, TResult fallbackValue, Action<DelegateResult<TResult>> onFallback)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls onFallback with details of the handled exception or result; then returns fallbackValue.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, Func<TResult> fallbackAction, Action<DelegateResult<TResult>> onFallback)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls onFallback with details of the handled exception or result; then calls fallbackAction and returns its result.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, Func<CancellationToken, TResult> fallbackAction, Action<DelegateResult<TResult>> onFallback)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls onFallback with details of the handled exception or result; then calls fallbackAction and returns its result.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, TResult fallbackValue, Action<DelegateResult<TResult>, Context> onFallback)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls onFallback with details of the handled exception or result and the execution context; then returns fallbackValue.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, Func<TResult> fallbackAction, Action<DelegateResult<TResult>, Context> onFallback)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls onFallback with details of the handled exception or result and the execution context; then calls fallbackAction and returns its result.
public static FallbackPolicy<TResult> Fallback<TResult>(this PolicyBuilder<TResult> policyBuilder, Func<CancellationToken, TResult> fallbackAction, Action<DelegateResult<TResult>, Context> onFallback)
Builds a FallbackPolicy which provides a fallback value if the main execution fails. Executes the main delegate, but if this throws a handled exception or raises a handled result, first calls onFallback with details of the handled exception or result and the execution context; then calls fallbackAction and returns its result.