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