Summary
Transforms the list matching the specific types and extecuting a function for them.
Syntax
public static IEnumerable<ReturnType> Match<Type1, Type2, Type3, BaseType, ReturnType>(this List<DiscriminatedUnionWithBase<Type1, Type2, Type3, BaseType>> values, Func<Type1, ReturnType> Function1, Func<Type2, ReturnType> Function2, Func<Type3, ReturnType> Function3)
where Type1 : BaseType where Type2 : BaseType where Type3 : BaseType
Type Parameters
Name |
Description |
Type1 |
Type1 |
Type2 |
Type2 |
Type3 |
Type3 |
BaseType |
|
ReturnType |
|
Parameters
Name |
Type |
Description |
values |
List<DiscriminatedUnionWithBase<Type1, Type2, Type3, 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 |
Return Value
Type |
Description |
IEnumerable<ReturnType> |
ReturnType |