Class OneOfBase<T1, T2, T3, T4, T5, T6>

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

Shared dispatch base for discriminated unions of six types.

public abstract class OneOfBase<T1, T2, T3, T4, T5, T6>

Type Parameters

T1
T2
T3
T4
T5
T6
Inheritance
OneOfBase<T1, T2, T3, T4, T5, T6>
Derived
Inherited Members
Extension Methods

Properties

AsT1

public T1 AsT1 { get; }

Property Value

T1

AsT2

public T2 AsT2 { get; }

Property Value

T2

AsT3

public T3 AsT3 { get; }

Property Value

T3

AsT4

public T4 AsT4 { get; }

Property Value

T4

AsT5

public T5 AsT5 { get; }

Property Value

T5

AsT6

public T6 AsT6 { get; }

Property Value

T6

IsT1

public bool IsT1 { get; }

Property Value

bool

IsT2

public bool IsT2 { get; }

Property Value

bool

IsT3

public bool IsT3 { get; }

Property Value

bool

IsT4

public bool IsT4 { get; }

Property Value

bool

IsT5

public bool IsT5 { get; }

Property Value

bool

IsT6

public bool IsT6 { get; }

Property Value

bool

Methods

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.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Match<TResult>(Func<T1, TResult>, Func<T2, TResult>, Func<T3, TResult>, Func<T4, TResult>, Func<T5, TResult>, Func<T6, TResult>)

public TResult Match<TResult>(Func<T1, TResult> case1, Func<T2, TResult> case2, Func<T3, TResult> case3, Func<T4, TResult> case4, Func<T5, TResult> case5, Func<T6, TResult> case6)

Parameters

case1 Func<T1, TResult>
case2 Func<T2, TResult>
case3 Func<T3, TResult>
case4 Func<T4, TResult>
case5 Func<T5, TResult>
case6 Func<T6, TResult>

Returns

TResult

Type Parameters

TResult

Switch(Action<T1>, Action<T2>, Action<T3>, Action<T4>, Action<T5>, Action<T6>)

public void Switch(Action<T1> case1, Action<T2> case2, Action<T3> case3, Action<T4> case4, Action<T5> case5, Action<T6> case6)

Parameters

case1 Action<T1>
case2 Action<T2>
case3 Action<T3>
case4 Action<T4>
case5 Action<T5>
case6 Action<T6>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.