OneOf-3.Match

OneOf<T1,T2,T3>.Match<TResult> method

Executes one of the provided functions based on the underlying type of the value.

public TResult Match<TResult>(Func<T1, TResult> func1, Func<T2, TResult> func2, 
    Func<T3, TResult> func3)
ParameterDescription
TResultThe return type of the functions.
func1The function to execute if the value is of type T1.
func2The function to execute if the value is of type T2.
func3The function to execute if the value is of type T3.

Return Value

The result of the executed function.

See Also