Table of Contents

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

exception Exception

The exception.

Returns

ValueTask<Outcome<TResult>>

A completed ValueTask<TResult> that produces Outcome<TResult>.

Type Parameters

TResult

The type of the result.

Exceptions

ArgumentNullException

Thrown when exception is null.

FromException<TResult>(Exception)

Returns a Outcome<TResult> with the given exception.

public static Outcome<TResult> FromException<TResult>(Exception exception)

Parameters

exception Exception

The exception.

Returns

Outcome<TResult>

An instance of Outcome<TResult>.

Type Parameters

TResult

The type of the result.

Exceptions

ArgumentNullException

Thrown when exception is 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

value TResult

The result value.

Returns

ValueTask<Outcome<TResult>>

A completed ValueTask<TResult> that produces Outcome<TResult>.

Type Parameters

TResult

The type of the result.

FromResult<TResult>(TResult?)

Returns a Outcome<TResult> with the given value.

public static Outcome<TResult> FromResult<TResult>(TResult? value)

Parameters

value TResult

The result value.

Returns

Outcome<TResult>

An instance of Outcome<TResult>.

Type Parameters

TResult

The type of the result.