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, Type7, Type8, Type9, BaseType, ReturnType>(this List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, 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, Func<Type7, ReturnType> Function7, Func<Type8, ReturnType> Function8, Func<Type9, ReturnType> Function9)
where Type1 : BaseType where Type2 : BaseType where Type3 : BaseType where Type4 : BaseType where Type5 : BaseType where Type6 : BaseType where Type7 : BaseType where Type8 : BaseType where Type9 : BaseType
Type Parameters
Name |
Description |
Type1 |
Type1 |
Type2 |
Type2 |
Type3 |
Type3 |
Type4 |
Type4 |
Type5 |
Type5 |
Type6 |
Type6 |
Type7 |
Type7 |
Type8 |
Type8 |
Type9 |
Type9 |
BaseType |
|
ReturnType |
|
Parameters
Name |
Type |
Description |
values |
List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, 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 |
Function7 |
Func<Type7, ReturnType> |
The function to execute for Type7 |
Function8 |
Func<Type8, ReturnType> |
The function to execute for Type8 |
Function9 |
Func<Type9, ReturnType> |
The function to execute for Type9 |
Return Value
Type |
Description |
IEnumerable<ReturnType> |
ReturnType |