OutcomeArguments<TResult, TArgs>
Encapsulates the outcome of a resilience operation or event and its associated arguments.
using Polly.Utils;
using System;
using System.Runtime.CompilerServices;
namespace Polly
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public readonly struct OutcomeArguments<[System.Runtime.CompilerServices.Nullable(2)] TResult, [System.Runtime.CompilerServices.Nullable(2)] TArgs>
{
[System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})]
public Outcome<TResult> Outcome {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})]
get;
}
public ResilienceContext Context { get; }
public TArgs Arguments { get; }
[System.Runtime.CompilerServices.Nullable(2)]
public Exception Exception {
[System.Runtime.CompilerServices.NullableContext(2)]
get {
return Outcome.Exception;
}
}
[System.Runtime.CompilerServices.Nullable(2)]
public TResult Result {
[System.Runtime.CompilerServices.NullableContext(2)]
get {
return Outcome.Result;
}
}
public OutcomeArguments(ResilienceContext context, [System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})] Outcome<TResult> outcome, TArgs arguments)
{
Guard.NotNull<ResilienceContext>(context, "context");
Context = context;
Outcome = outcome;
Arguments = arguments;
}
}
}