FallbackStrategyOptions<TResult>
Represents the options for configuring a fallback resilience strategy with a specific result type.
using Polly.Utils;
using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace Polly.Fallback
{
public class FallbackStrategyOptions<[System.Runtime.CompilerServices.Nullable(2)] TResult> : ResilienceStrategyOptions
{
[System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
[Required]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
public Func<FallbackPredicateArguments<TResult>, ValueTask<bool>> ShouldHandle {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
set;
} = DefaultPredicates<FallbackPredicateArguments<TResult>, TResult>.HandleOutcome;
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1,
0,
0,
1
})]
[Required]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1,
0,
0,
1
})]
public Func<FallbackActionArguments<TResult>, ValueTask<Outcome<TResult>>> FallbackAction {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1,
0,
0,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1,
0,
0,
1
})]
set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1
})]
public Func<OnFallbackArguments<TResult>, ValueTask> OnFallback {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1
})]
set;
}
public FallbackStrategyOptions()
{
base.Name = "Fallback";
}
}
}