OneOfT1T2T3 Class

OneOf<T1,T2,T3> class

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

public class OneOf<T1, T2, T3>
ParameterDescription
T1The type of the first possible value.
T2The type of the second possible value.
T3The type of the third 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.
OneOf(T3)Initializes a new instance of the OneOf class with a value of type T3.

Methods

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

See Also