Table of Contents

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

T1

The first type.

T2

The second type.

T3

The third type.

T4

The fourth type.

Implements
IMixed<Mixed<T1, T2, T3, T4>>
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

value T1

The item, or the default value of the type.

Returns

bool

true if the item is of this type.

Is(out T2)

Gets the item if it is of the second type.

public bool Is(out T2 value)

Parameters

value T2

The item, or the default value of the type.

Returns

bool

true if the item is of this type.

Is(out T3)

Gets the item if it is of the third type.

public bool Is(out T3 value)

Parameters

value T3

The item, or the default value of the type.

Returns

bool

true if the item is of this type.

Is(out T4)

Gets the item if it is of the fourth type.

public bool Is(out T4 value)

Parameters

value T4

The item, or the default value of the type.

Returns

bool

true if the item is of this type.

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

first Action<T1>

What to do with an item of the first type.

second Action<T2>

What to do with an item of the second type.

third Action<T3>

What to do with an item of the third type.

fourth Action<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

first Func<T1, TResult>

What to do with an item of the first type.

second Func<T2, TResult>

What to do with an item of the second type.

third Func<T3, TResult>

What to do with an item of the third type.

fourth Func<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

TResult

The type of the result.

Exceptions

ArgumentNullException

A function is null.

InvalidOperationException

This is the default value, which holds nothing.