DiscriminatedUnionListExtensions.

Match<Type1, Type2, Type3, Type4, BaseType, ReturnType>(List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, BaseType>>, Func<Type1, ReturnType>, Func<Type2, ReturnType>, Func<Type3, ReturnType>, Func<Type4, 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, BaseType, ReturnType>(this List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, BaseType>> values, Func<Type1, ReturnType> Function1, Func<Type2, ReturnType> Function2, Func<Type3, ReturnType> Function3, Func<Type4, ReturnType> Function4) 
    where Type1 : BaseType where Type2 : BaseType where Type3 : BaseType where Type4 : BaseType

Type Parameters

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

Parameters

Name Type Description
values List<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, 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

Return Value

Type Description
IEnumerable<ReturnType> ReturnType