DiscriminatedUnionIEnumerableExtensions.

Match<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, ReturnType>(IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9>>, Func<Type1, ReturnType>, Func<Type2, ReturnType>, Func<Type3, ReturnType>, Func<Type4, ReturnType>, Func<Type5, ReturnType>, Func<Type6, ReturnType>, Func<Type7, ReturnType>, Func<Type8, ReturnType>, Func<Type9, ReturnType>) Method

Summary

Matches the specific types and uses the given functions to tranform into s ingle returntype.

Syntax

public static IEnumerable<ReturnType> Match<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, ReturnType>(this IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9>> values, Func<Type1, ReturnType> Function1, Func<Type2, ReturnType> Function2, Func<Type3, ReturnType> Function3, Func<Type4, ReturnType> Function4, Func<Type5, ReturnType> Function5, Func<Type6, ReturnType> Function6, Func<Type7, ReturnType> Function7, Func<Type8, ReturnType> Function8, Func<Type9, ReturnType> Function9)

Type Parameters

Name Description
Type1 Type1
Type2 Type2
Type3 Type3
Type4 Type4
Type5 Type5
Type6 Type6
Type7 Type7
Type8 Type8
Type9 Type9
ReturnType the returntype for all functions

Parameters

Name Type Description
values IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9>> existing Discriminated unions
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
Function6 Func<Type6, ReturnType> Function to run for Type6
Function7 Func<Type7, ReturnType> Function to run for Type7
Function8 Func<Type8, ReturnType> Function to run for Type8
Function9 Func<Type9, ReturnType> Function to run for Type9

Return Value

Type Description
IEnumerable<ReturnType>