<PackageReference Include="Polly" Version="4.5.0-beta-netstandar-0001" />

ContextualPolicy<TResult>

public class ContextualPolicy<TResult> : Policy<TResult>
Transient fault handling policies that can be applied to delegates returning results of type These policies can be called with arbitrary context data.
public TResult Execute(Func<TResult> action, IDictionary<string, object> contextData)

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

public PolicyResult<TResult> ExecuteAndCapture(Func<TResult> action, IDictionary<string, object> contextData)

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

public Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<Task<TResult>> action, IDictionary<string, object> contextData)

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

protected Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<Task<TResult>> action, IDictionary<string, object> contextData, bool continueOnCapturedContext)

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

public Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<Task<TResult>> action, IDictionary<string, object> contextData, CancellationToken cancellationToken)

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

public Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<CancellationToken, Task<TResult>> action, IDictionary<string, object> contextData, CancellationToken cancellationToken, bool continueOnCapturedContext)

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

public Task<TResult> ExecuteAsync(Func<Task<TResult>> action, IDictionary<string, object> contextData)

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

public Task<TResult> ExecuteAsync(Func<Task<TResult>> action, IDictionary<string, object> contextData, bool continueOnCapturedContext)

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

public Task<TResult> ExecuteAsync(Func<CancellationToken, Task<TResult>> action, IDictionary<string, object> contextData, CancellationToken cancellationToken)

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

public Task<TResult> ExecuteAsync(Func<CancellationToken, Task<TResult>> action, IDictionary<string, object> contextData, CancellationToken cancellationToken, bool continueOnCapturedContext)

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