OneOfT1T2 Class

OneOf<T1,T2> class

Represents a value that can be one of two distinct types, T1 or T2.

public class OneOf<T1, T2>
ParameterDescription
T1The type of the first possible value.
T2The type of the second possible value.

Constructors

NameDescription
OneOf(T1)Initializes a new instance of the OneOf class with a value of type T1.
OneOf(T2)Initializes a new instance of the OneOf class with a value of type T2.

Methods

NameDescription
Match<TResult>(Func<T1, TResult>, Func<T2, TResult>)Executes one of the provided functions based on the underlying type of the value.
implicit operator(2 operators)

See Also