Table of Contents

Method Match

Namespace
SodaFlow.Functional
Assembly
SodaFlow.Functional.dll

Match<T>(Func<object?, T>, Func<object?, T>, Func<object?, T>, Func<object?, T>, Func<object?, T>, Func<object?, T>)

Runs one of the six functions depending on which case is held, and returns its result.

T Match<T>(Func<object?, T> onFirst, Func<object?, T> onSecond, Func<object?, T> onThird, Func<object?, T> onFourth, Func<object?, T> onFifth, Func<object?, T> onSixth)

Parameters

onFirst Func<object, T>

Run with the value when the first case is held.

onSecond Func<object, T>

Run with the value when the second case is held.

onThird Func<object, T>

Run with the value when the third case is held.

onFourth Func<object, T>

Run with the value when the fourth case is held.

onFifth Func<object, T>

Run with the value when the fifth case is held.

onSixth Func<object, T>

Run with the value when the sixth case is held.

Returns

T

Whatever the function that was run returned.

Type Parameters

T

The type each of the functions returns.

Remarks

This is the only member that reads the held value, and it expresses each other member here. This calls one function of the set, and it calls that function before this method returns.