DiscriminatedUnionListExtensions.

Match<Type1, Type2, Type3, Type4, Type5, Type6, BaseType, ReturnType>(List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType>>, Func<Type1, ReturnType>, Func<Type2, ReturnType>, Func<Type3, ReturnType>, Func<Type4, ReturnType>, Func<Type5, ReturnType>, Func<Type6, ReturnType>) Method

Summary

Transforms the list matching the specific types and extecuting a function for them.

Syntax

public static IEnumerable<ReturnType> Match<Type1, Type2, Type3, Type4, Type5, Type6, BaseType, ReturnType>(this List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType>> 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) 
    where Type1 : BaseType where Type2 : BaseType where Type3 : BaseType where Type4 : BaseType where Type5 : BaseType where Type6 : BaseType

Type Parameters

Name Description
Type1 Type1
Type2 Type2
Type3 Type3
Type4 Type4
Type5 Type5
Type6 Type6
BaseType
ReturnType

Parameters

Name Type Description
values List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType>>
Function1 Func<Type1, ReturnType> The function to execute for Type1
Function2 Func<Type2, ReturnType> The function to execute for Type2
Function3 Func<Type3, ReturnType> The function to execute for Type3
Function4 Func<Type4, ReturnType> The function to execute for Type4
Function5 Func<Type5, ReturnType> The function to execute for Type5
Function6 Func<Type6, ReturnType> The function to execute for Type6

Return Value

Type Description
IEnumerable<ReturnType> ReturnType