Class ErrorsOf<T1, T2, T3, T4, T5>

Namespace
REslava.Result.AdvancedPatterns
Assembly
REslava.Result.dll

A type-safe error union of five possible error types.

public sealed class ErrorsOf<T1, T2, T3, T4, T5> : OneOfBase<T1, T2, T3, T4, T5>, IOneOf<T1, T2, T3, T4, T5>, IError, IReason, IEquatable<ErrorsOf<T1, T2, T3, T4, T5>> where T1 : IError where T2 : IError where T3 : IError where T4 : IError where T5 : IError

Type Parameters

T1
T2
T3
T4
T5
Inheritance
OneOfBase<T1, T2, T3, T4, T5>
ErrorsOf<T1, T2, T3, T4, T5>
Implements
IOneOf<T1, T2, T3, T4, T5>
IEquatable<ErrorsOf<T1, T2, T3, T4, T5>>
Inherited Members
Extension Methods

Properties

Message

Gets the human-readable description of this reason.

public string Message { get; init; }

Property Value

string

Tags

Gets the structured metadata attached to this reason. Keys are string labels; values are arbitrary objects (e.g. HTTP status codes, field names). Use WithTag on any concrete reason to attach metadata fluently.

public ImmutableDictionary<string, object> Tags { get; init; }

Property Value

ImmutableDictionary<string, object>

Methods

Equals(ErrorsOf<T1, T2, T3, T4, T5>?)

Determines equality between two ErrorsOf instances.

public bool Equals(ErrorsOf<T1, T2, T3, T4, T5>? other)

Parameters

other ErrorsOf<T1, T2, T3, T4, T5>

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

FromT1(T1)

Creates an ErrorsOf containing a T1 error.

public static ErrorsOf<T1, T2, T3, T4, T5> FromT1(T1 value)

Parameters

value T1

Returns

ErrorsOf<T1, T2, T3, T4, T5>

FromT2(T2)

Creates an ErrorsOf containing a T2 error.

public static ErrorsOf<T1, T2, T3, T4, T5> FromT2(T2 value)

Parameters

value T2

Returns

ErrorsOf<T1, T2, T3, T4, T5>

FromT3(T3)

Creates an ErrorsOf containing a T3 error.

public static ErrorsOf<T1, T2, T3, T4, T5> FromT3(T3 value)

Parameters

value T3

Returns

ErrorsOf<T1, T2, T3, T4, T5>

FromT4(T4)

Creates an ErrorsOf containing a T4 error.

public static ErrorsOf<T1, T2, T3, T4, T5> FromT4(T4 value)

Parameters

value T4

Returns

ErrorsOf<T1, T2, T3, T4, T5>

FromT5(T5)

Creates an ErrorsOf containing a T5 error.

public static ErrorsOf<T1, T2, T3, T4, T5> FromT5(T5 value)

Parameters

value T5

Returns

ErrorsOf<T1, T2, T3, T4, T5>

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Operators

operator ==(ErrorsOf<T1, T2, T3, T4, T5>?, ErrorsOf<T1, T2, T3, T4, T5>?)

Equality operator.

public static bool operator ==(ErrorsOf<T1, T2, T3, T4, T5>? left, ErrorsOf<T1, T2, T3, T4, T5>? right)

Parameters

left ErrorsOf<T1, T2, T3, T4, T5>
right ErrorsOf<T1, T2, T3, T4, T5>

Returns

bool

implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T1)

Implicit conversion from T1.

public static implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T1 value)

Parameters

value T1

Returns

ErrorsOf<T1, T2, T3, T4, T5>

implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T2)

Implicit conversion from T2.

public static implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T2 value)

Parameters

value T2

Returns

ErrorsOf<T1, T2, T3, T4, T5>

implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T3)

Implicit conversion from T3.

public static implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T3 value)

Parameters

value T3

Returns

ErrorsOf<T1, T2, T3, T4, T5>

implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T4)

Implicit conversion from T4.

public static implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T4 value)

Parameters

value T4

Returns

ErrorsOf<T1, T2, T3, T4, T5>

implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T5)

Implicit conversion from T5.

public static implicit operator ErrorsOf<T1, T2, T3, T4, T5>(T5 value)

Parameters

value T5

Returns

ErrorsOf<T1, T2, T3, T4, T5>

operator !=(ErrorsOf<T1, T2, T3, T4, T5>?, ErrorsOf<T1, T2, T3, T4, T5>?)

Inequality operator.

public static bool operator !=(ErrorsOf<T1, T2, T3, T4, T5>? left, ErrorsOf<T1, T2, T3, T4, T5>? right)

Parameters

left ErrorsOf<T1, T2, T3, T4, T5>
right ErrorsOf<T1, T2, T3, T4, T5>

Returns

bool