DiscriminatedUnionIEnumerableExtensions.

Match<Type1, Type2, ReturnType>(IEnumerable<DiscriminatedUnion<Type1, Type2>>, Func<Type1, ReturnType>, Func<Type2, ReturnType>) Method

Summary

Matches the specific types and uses the given functions to tranform into s ingle returntype.

Syntax

public static IEnumerable<ReturnType> Match<Type1, Type2, ReturnType>(this IEnumerable<DiscriminatedUnion<Type1, Type2>> values, Func<Type1, ReturnType> Function1, Func<Type2, ReturnType> Function2)

Type Parameters

Name Description
Type1 Type1
Type2 Type2
ReturnType the returntype for all functions

Parameters

Name Type Description
values IEnumerable<DiscriminatedUnion<Type1, Type2>> existing Discriminated unions
Function1 Func<Type1, ReturnType> Function to run for Type1
Function2 Func<Type2, ReturnType> Function to run for Type2

Return Value

Type Description
IEnumerable<ReturnType>