DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>.

Match<ReturnType>(Func<Type1, ReturnType>, Func<Type2, ReturnType>, Func<Type3, ReturnType>, Func<Type4, ReturnType>, Func<Type5, ReturnType>) Method

Summary

Transforms the union into a new type using the given functions for the transformation.

Syntax

public ReturnType Match<ReturnType>(Func<Type1, ReturnType> Function1, Func<Type2, ReturnType> Function2, Func<Type3, ReturnType> Function3, Func<Type4, ReturnType> Function4, Func<Type5, ReturnType> Function5)

Type Parameters

Name Description
ReturnType

Parameters

Name Type Description
Function1 Func<Type1, ReturnType> Function to run for Type1
Function2 Func<Type2, ReturnType> Function to run for Type2
Function3 Func<Type3, ReturnType> Function to run for Type3
Function4 Func<Type4, ReturnType> Function to run for Type4
Function5 Func<Type5, ReturnType> Function to run for Type5

Return Value

Type Description
ReturnType