<PackageReference Include="Polly.Core" Version="8.0.0-alpha.3" />

PredicateBuilder<TResult>

public class PredicateBuilder<TResult>
Defines a builder for creating predicates for TResult and Exception combinations.

public static Func<OutcomeArguments<TResult, RetryPredicateArguments>, ValueTask<bool>> op_Implicit(PredicateBuilder<TResult> builder)

The operator that converts builder to ShouldHandle delegate.

public static Func<OutcomeArguments<TResult, HedgingPredicateArguments>, ValueTask<bool>> op_Implicit(PredicateBuilder<TResult> builder)

The operator that converts builder to ShouldHandle delegate.

public static Func<OutcomeArguments<TResult, FallbackPredicateArguments>, ValueTask<bool>> op_Implicit(PredicateBuilder<TResult> builder)

The operator that converts builder to ShouldHandle delegate.

The operator that converts builder to ShouldHandle delegate.

public Predicate<Outcome<TResult>> Build()

Builds the predicate.

public Func<OutcomeArguments<TResult, TArgs>, ValueTask<bool>> Build<TArgs>()

Builds the predicate for delegates that use OutcomeArguments<T, U> and return ValueTask<T> of Boolean.

public PredicateBuilder<TResult> Handle<TException>() where TException : Exception

Adds a predicate for handling exceptions of the specified type.

public PredicateBuilder<TResult> Handle<TException>(Func<TException, bool> predicate) where TException : Exception

Adds a predicate for handling exceptions of the specified type.

public PredicateBuilder<TResult> HandleInner<TException>() where TException : Exception

Adds a predicate for handling inner exceptions of the specified type.

public PredicateBuilder<TResult> HandleInner<TException>(Func<TException, bool> predicate) where TException : Exception

Adds a predicate for handling inner exceptions of the specified type.

public PredicateBuilder<TResult> HandleResult(Func<TResult, bool> predicate)

Adds a predicate for handling results.

public PredicateBuilder<TResult> HandleResult(TResult result, IEqualityComparer<TResult> comparer = null)

Adds a predicate for handling results with a specific value.