Struct Mixed<T1, T2, T3, T4>
- Namespace
- DynaSharp
- Assembly
- DynaSharp.dll
One item of a mixed read of 4 types. See Mixed<T1, T2>.
public readonly struct Mixed<T1, T2, T3, T4> : IMixed<Mixed<T1, T2, T3, T4>>, IDynamoDbDocument<Mixed<T1, T2, T3, T4>> where T1 : IDynamoDbDiscriminated<T1> where T2 : IDynamoDbDiscriminated<T2> where T3 : IDynamoDbDiscriminated<T3> where T4 : IDynamoDbDiscriminated<T4>
Type Parameters
T1The first type.
T2The second type.
T3The third type.
T4The fourth type.
- Implements
-
IDynamoDbDocument<Mixed<T1, T2, T3, T4>>
- Inherited Members
Methods
Is(out T1)
Gets the item if it is of the first type.
public bool Is(out T1 value)
Parameters
valueT1The item, or the default value of the type.
Returns
Is(out T2)
Gets the item if it is of the second type.
public bool Is(out T2 value)
Parameters
valueT2The item, or the default value of the type.
Returns
Is(out T3)
Gets the item if it is of the third type.
public bool Is(out T3 value)
Parameters
valueT3The item, or the default value of the type.
Returns
Is(out T4)
Gets the item if it is of the fourth type.
public bool Is(out T4 value)
Parameters
valueT4The item, or the default value of the type.
Returns
Match(Action<T1>, Action<T2>, Action<T3>, Action<T4>)
Does something with the item, with one action per type, so no type can be forgotten.
public void Match(Action<T1> first, Action<T2> second, Action<T3> third, Action<T4> fourth)
Parameters
firstAction<T1>What to do with an item of the first type.
secondAction<T2>What to do with an item of the second type.
thirdAction<T3>What to do with an item of the third type.
fourthAction<T4>What to do with an item of the fourth type.
Exceptions
- ArgumentNullException
An action is null.
- InvalidOperationException
This is the default value, which holds nothing.
Match<TResult>(Func<T1, TResult>, Func<T2, TResult>, Func<T3, TResult>, Func<T4, TResult>)
Computes a result from the item, with one function per type, so no type can be forgotten.
public TResult Match<TResult>(Func<T1, TResult> first, Func<T2, TResult> second, Func<T3, TResult> third, Func<T4, TResult> fourth)
Parameters
firstFunc<T1, TResult>What to do with an item of the first type.
secondFunc<T2, TResult>What to do with an item of the second type.
thirdFunc<T3, TResult>What to do with an item of the third type.
fourthFunc<T4, TResult>What to do with an item of the fourth type.
Returns
- TResult
The result of the function of the type of the item.
Type Parameters
TResultThe type of the result.
Exceptions
- ArgumentNullException
A function is null.
- InvalidOperationException
This is the default value, which holds nothing.