Class Outcome
- Namespace
- Polly
- Assembly
- Polly.Core.dll
Produces instances of Outcome<TResult>.
public static class Outcome
- Inheritance
-
Outcome
- Inherited Members
Methods
FromExceptionAsValueTask<TResult>(Exception)
Returns a Outcome<TResult> with the given exception wrapped as ValueTask<TResult>.
public static ValueTask<Outcome<TResult>> FromExceptionAsValueTask<TResult>(Exception exception)
Parameters
exceptionExceptionThe exception.
Returns
- ValueTask<Outcome<TResult>>
A completed ValueTask<TResult> that produces Outcome<TResult>.
Type Parameters
TResultThe type of the result.
Exceptions
- ArgumentNullException
Thrown when
exceptionis null.
FromException<TResult>(Exception)
Returns a Outcome<TResult> with the given exception.
public static Outcome<TResult> FromException<TResult>(Exception exception)
Parameters
exceptionExceptionThe exception.
Returns
- Outcome<TResult>
An instance of Outcome<TResult>.
Type Parameters
TResultThe type of the result.
Exceptions
- ArgumentNullException
Thrown when
exceptionis null.
FromResultAsValueTask<TResult>(TResult)
Returns a Outcome<TResult> with the given value wrapped as ValueTask<TResult>.
public static ValueTask<Outcome<TResult>> FromResultAsValueTask<TResult>(TResult value)
Parameters
valueTResultThe result value.
Returns
- ValueTask<Outcome<TResult>>
A completed ValueTask<TResult> that produces Outcome<TResult>.
Type Parameters
TResultThe type of the result.
FromResult<TResult>(TResult?)
Returns a Outcome<TResult> with the given value.
public static Outcome<TResult> FromResult<TResult>(TResult? value)
Parameters
valueTResultThe result value.
Returns
- Outcome<TResult>
An instance of Outcome<TResult>.
Type Parameters
TResultThe type of the result.