Open sandboxFocus

Property Cases

Cases

Gets the cases of the union, in the order in which the creation members of the union declare them, which is the order of the union header for a union declaration.

Declaration
IReadOnlyList<IUnionCase> Cases { get; }
Property Value
Type Description
IReadOnlyList<IUnionCase>
Remarks

The list is never empty for a well-formed union, because the language requires a union to have at least one case.

A type occurs once in the list, as it does in the case set of the compiler. Two creation members that take the same type therefore declare one case, whose CreationMember is the first of the two.