Class Result

Namespace
Cratis.Monads
Assembly
Cratis.Fundamentals.dll

Convenience methods for creating Result instances.

public class Result
Inheritance
Result
Inherited Members
Extension Methods

Properties

IsSuccess

Gets a value indicating whether the execution was successful.

public bool IsSuccess { get; init; }

Property Value

bool

Methods

Failed()

Creates a failed Result.

public static Result Failed()

Returns

Result

The created Result.

Failed<TError>(TError)

Creates a failed Result<TError>.

public static Result<TError> Failed<TError>(TError error)

Parameters

error TError

The error.

Returns

Result<TError>

The created Result<TError>.

Type Parameters

TError

The type of the error.

Failed<TResult, TError>(TError)

Creates a failed Result<TError>.

public static Result<TResult, TError> Failed<TResult, TError>(TError error)

Parameters

error TError

The error.

Returns

Result<TResult, TError>

The created Result<TError>.

Type Parameters

TResult

The result type.

TError

The error type.

Success()

Creates a successful Result.

public static Result Success()

Returns

Result

The created Result.

Success<TError>()

Creates a successful Result<TError>.

public static Result<TError> Success<TError>()

Returns

Result<TError>

The created Result<TError>.

Type Parameters

TError

The type of the error.

Success<TResult, TError>(TResult)

Creates a successful Result<TError>.

public static Result<TResult, TError> Success<TResult, TError>(TResult value)

Parameters

value TResult

The value.

Returns

Result<TResult, TError>

The created Result<TError>.

Type Parameters

TResult

The result type.

TError

The error type.