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

Outcome<TResult>

public struct Outcome<TResult>
Represents the outcome of an operation which could be a result of type TResult or an exception.
public Exception Exception { get; }

Gets the exception that occurred during the operation, if any.

public bool HasResult { get; }

Gets a value indicating whether the operation produced a result.

public bool IsVoidResult { get; }

Gets a value indicating whether the operation produced a void result.

public TResult Result { get; }

Gets the result of the operation, if any.

public Outcome(Exception exception)

Initializes a new instance of the Outcome<T> struct.

public Outcome(TResult result)

Initializes a new instance of the Outcome<T> struct.

public void EnsureSuccess()

Throws an exception if the operation produced an exception.

public bool TryGetResult(out TResult result)

Tries to get the result, if available.