Table of Contents

Class ExceptionResultExtensions

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

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

public static class ExceptionResultExtensions
Inheritance
ExceptionResultExtensions
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 : Exception

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.