Table of Contents

Interface IActionableResult<TResult>

Namespace
LightResults.Common
Assembly
LightResults.dll

Defines an actionable result.

public interface IActionableResult<out TResult> : IResult where TResult : IResult

Type Parameters

TResult

Implements

Methods

Failure()

Creates a failure result.

public static abstract TResult Failure()

Returns

TResult

A new instance of TResult representing a failure result.

Failure(string)

Creates a failure result with the given error message.

public static abstract TResult Failure(string errorMessage)

Parameters

errorMessage string

The error message associated with the failure.

Returns

TResult

A new instance of TResult representing a failure result with the specified error message.

Failure(string, (string Key, object Value))

Creates a failure result with the given error message and metadata.

public static abstract TResult Failure(string errorMessage, (string Key, object Value) metadata)

Parameters

errorMessage string

The error message associated with the failure.

metadata (string Key, object Value)

The metadata associated with the failure.

Returns

TResult

A new instance of TResult representing a failure result with the specified error message and metadata.

Failure(string, KeyValuePair<string, object>)

Creates a failure result with the given error message and metadata.

public static abstract TResult Failure(string errorMessage, KeyValuePair<string, object> metadata)

Parameters

errorMessage string

The error message associated with the failure.

metadata KeyValuePair<string, object>

The metadata associated with the failure.

Returns

TResult

A new instance of TResult representing a failure result with the specified error message and metadata.

Failure(string, IReadOnlyDictionary<string, object>)

Creates a failure result with the given error message and metadata.

public static abstract TResult Failure(string errorMessage, IReadOnlyDictionary<string, object> metadata)

Parameters

errorMessage string

The error message associated with the failure.

metadata IReadOnlyDictionary<string, object>

The metadata associated with the failure.

Returns

TResult

A new instance of TResult representing a failure result with the specified error message and metadata.

Failure(IError)

Creates a failure result with the given error.

public static abstract TResult Failure(IError error)

Parameters

error IError

The error associated with the failure.

Returns

TResult

A new instance of TResult representing a failure result with the specified error.

Failure(IEnumerable<IError>)

Creates a failure result with the given errors.

public static abstract TResult Failure(IEnumerable<IError> errors)

Parameters

errors IEnumerable<IError>

A collection of errors associated with the failure.

Returns

TResult

A new instance of TResult representing a failure result with the specified errors.

Failure(IReadOnlyList<IError>)

Creates a failure result with the given errors.

public static abstract TResult Failure(IReadOnlyList<IError> errors)

Parameters

errors IReadOnlyList<IError>

A collection of errors associated with the failure.

Returns

TResult

A new instance of TResult representing a failure result with the specified errors.

Success()

Creates a success result.

public static abstract TResult Success()

Returns

TResult

A new instance of TResult representing a success result with the specified value.