Class OneOfBase<T1, T2, T3, T4, T5, T6, T7>
- Namespace
- REslava.Result.AdvancedPatterns
- Assembly
- REslava.Result.dll
Shared dispatch base for discriminated unions of seven types.
public abstract class OneOfBase<T1, T2, T3, T4, T5, T6, T7>
Type Parameters
T1T2T3T4T5T6T7
- Inheritance
-
OneOfBase<T1, T2, T3, T4, T5, T6, T7>
- 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
AsT7
public T7 AsT7 { get; }
Property Value
- T7
IsT1
public bool IsT1 { get; }
Property Value
IsT2
public bool IsT2 { get; }
Property Value
IsT3
public bool IsT3 { get; }
Property Value
IsT4
public bool IsT4 { get; }
Property Value
IsT5
public bool IsT5 { get; }
Property Value
IsT6
public bool IsT6 { get; }
Property Value
IsT7
public bool IsT7 { get; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
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>, Func<T7, 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, Func<T7, TResult> case7)
Parameters
case1Func<T1, TResult>case2Func<T2, TResult>case3Func<T3, TResult>case4Func<T4, TResult>case5Func<T5, TResult>case6Func<T6, TResult>case7Func<T7, TResult>
Returns
- TResult
Type Parameters
TResult
Switch(Action<T1>, Action<T2>, Action<T3>, Action<T4>, Action<T5>, Action<T6>, Action<T7>)
public void Switch(Action<T1> case1, Action<T2> case2, Action<T3> case3, Action<T4> case4, Action<T5> case5, Action<T6> case6, Action<T7> case7)
Parameters
case1Action<T1>case2Action<T2>case3Action<T3>case4Action<T4>case5Action<T5>case6Action<T6>case7Action<T7>
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.