A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://dotnet.github.io/dotNext/api/DotNext.Result.html below:

Class Result | .NEXT

Class Result

Represents extension methods for type Result<T>.

Namespace: DotNext Assembly: DotNext.dll Syntax
public static class Result
Methods | Edit this page View Source Coalesce<T>(in Result<T>, in Result<T>)

Returns the second result if the first is unsuccessful.

Declaration
public static ref readonly Result<T> Coalesce<T>(this in Result<T> first, in Result<T> second)
Parameters Type Name Description Result<T> first

The first result.

Result<T> second

The second result.

Returns Type Description Result<T>

The second result if the first is unsuccessful; otherwise, the first result.

Type Parameters Name Description T

The type of value.

| Edit this page View Source EnsureNotNull<T>(Result<T?>)

Ensures that the specified result doesn't contain null value.

Declaration
public static Result<T> EnsureNotNull<T>(this Result<T?> result) where T : class
Parameters Type Name Description Result<T> result

The result to be checked.

Returns Type Parameters Name Description T

The type of the result.

| Edit this page View Source EnsureNotNull<T, TException>(Result<T?>)

Ensures that the specified result doesn't contain null value.

Declaration
public static Result<T> EnsureNotNull<T, TException>(this Result<T?> result) where T : class where TException : Exception, new()
Parameters Type Name Description Result<T> result

The result to be checked.

Returns Type Description Result<T>

The result containing non-null value; or as an error.

Type Parameters Name Description T

The type of the result.

TException

The type of the exception to be returned from the null result.

| Edit this page View Source FromException<T>(Exception)

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

Declaration
public static Result<T> FromException<T>(Exception e)
Parameters Type Name Description Exception e

The exception to be placed to the container.

Returns Type Parameters Name Description T

The type of the value.

| Edit this page View Source FromValue<T>(T)

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

Declaration
public static Result<T> FromValue<T>(T value)
Parameters Type Name Description T value

The value to be placed to the container.

Returns Type Parameters Name Description T

The type of the value.

| Edit this page View Source GetUnderlyingType(Type)

Returns the underlying type argument of the specified result type.

Declaration
public static Type? GetUnderlyingType(Type resultType)
Parameters Type Name Description Type resultType

Result type.

Returns Type Description Type

Underlying type argument of the result type; otherwise, null.

| Edit this page View Source IsResult(Type)

Indicates that the specified type is the result type.

Declaration
public static bool IsResult(this Type resultType)
Parameters Returns Type Description bool

true, if specified type is result type; otherwise, false.

| Edit this page View Source OrNull<T>(in Result<T>)

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

Declaration
public static T? OrNull<T>(this in Result<T> result) where T : struct
Parameters Type Name Description Result<T> result

The result.

Returns Type Description T?

Nullable value.

Type Parameters Name Description T

Value type.

| Edit this page View Source OrNull<T, TError>(in Result<T, TError>)

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

Declaration
public static T? OrNull<T, TError>(this in Result<T, TError> result) where T : struct where TError : struct, Enum
Parameters Type Name Description Result<T, TError> result

The result.

Returns Type Description T?

Nullable value.

Type Parameters Name Description T

Value type.

TError

The type of the error code.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4