Table of Contents

Class Result

Namespace
Whim
Assembly
Whim.dll
Provides static methods for creating Result instances.
public static class Result
Inheritance
Result
Inherited Members

Methods

FromError<T>(WhimError)

Creates a failed result from an error.
public static Result<T> FromError<T>(WhimError error)

Parameters

error WhimError
The error to wrap in the result.

Returns

Result<T>
A failed result containing the error.

Type Parameters

T
The type of the value.

FromException<T>(Exception)

Creates a failed result from an exception (for backward compatibility).
public static Result<T> FromException<T>(Exception exception)

Parameters

exception Exception
The exception to convert to an error.

Returns

Result<T>
A failed result containing the error.

Type Parameters

T
The type of the value.

FromValue<T>(T)

Creates a successful result from a value.
public static Result<T> FromValue<T>(T value)

Parameters

value T
The value to wrap in the result.

Returns

Result<T>
A successful result containing the value.

Type Parameters

T
The type of the value.