ComponentResultType Class

A result type: a success with an optional value, or an error with an optional value.

public sealed class ComponentResultType : ComponentValueType
Inheritance
ComponentValueType ComponentResultType

Constructors

NameDescription
ComponentResultType(ComponentValueType?, ComponentValueType?)Initializes a new instance of the ComponentResultType class.

ComponentResultType(ComponentValueType?, ComponentValueType?)

ComponentTypes.cs

Initializes a new instance of the ComponentResultType class.

public ComponentResultType(ComponentValueType? ok, ComponentValueType? error)

Parameters

ok ComponentValueType?
The type of the value of a success, or null.
error ComponentValueType?
The type of the value of an error, or null.

Properties

NameDescription
ErrorGets the type of the value of an error, or null.
OkGets the type of the value of a success, or null.

Gets the type of the value of an error, or null.

public ComponentValueType? Error { get; }

Property value

ComponentValueType?

Gets the type of the value of a success, or null.

public ComponentValueType? Ok { get; }

Property value

ComponentValueType?

Methods

NameDescription
Equals(ComponentValueType?)Indicates whether the current object is equal to another object of the same type.
GetHashCode()Serves as the default hash function.

Equals(ComponentValueType?)

ComponentTypes.cs

Indicates whether the current object is equal to another object of the same type.

public override bool Equals(ComponentValueType? other)

Parameters

other ComponentValueType?
An object to compare with this object.

Returns

bool true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

ComponentTypes.cs

Serves as the default hash function.

public override int GetHashCode()

Returns

int A hash code for the current object.