Table of Contents

Class IErrorResultExtensions

Namespace
Badeend.Results.Extensions
Assembly
Badeend.Result.dll

Extensions for Result<T, TError> where TError : IError.

public static class IErrorResultExtensions
Inheritance
IErrorResultExtensions
Inherited Members

Remarks

These extension methods have been split out from ResultExtensions because .NET does not support overloading methods based on generic constraints only.

Methods

AsBasicResult<TValue, TError>(Result<TValue, TError>)

Convert the result's error value into a new Error. If the result is successful, this method is a no-op.

[Pure]
public static Result<TValue> AsBasicResult<TValue, TError>(this Result<TValue, TError> result) where TError : IError

Parameters

result Result<TValue, TError>

Returns

Result<TValue>

Type Parameters

TValue
TError

Remarks

This is an O(1) operation and does not allocate any memory.