DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.9.0" />

.NET API 564,632 bytes

 Result

public static class Result
Represents extension methods for type Result<T>.
public static Result Coalesce<T>(this ref Result first, ref Result second)

Returns the second result if the first is unsuccessful.

public static Result<T> FromException<T>(Exception e)

Creates a new instance of Result<T> from the specified exception.

public static Result<T> FromValue<T>(T value)

Creates a new instance of Result<T> from the specified value.

public static T& modreq(System.Runtime.InteropServices.InAttribute) GetReference<T>(ref Result result)

Gets a reference to the underlying value.

public static T& modreq(System.Runtime.InteropServices.InAttribute) GetReference<T, TError>(ref Result result) where TError : struct, Enum

Gets a reference to the underlying value.

public static Type GetUnderlyingType(Type resultType)

Returns the underlying type argument of the specified result type.

public static bool IsResult(this Type resultType)

Indicates that specified type is result type.

public static T? OrNull<T>(this ref Result result) where T : struct

If a result is successful, returns it, otherwise null.

public static T? OrNull<T, TError>(this ref Result result) where T : struct where TError : struct, Enum

If a result is successful, returns it, otherwise null.