Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/csharp/language-reference/builtin-types/union.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ The compiler prefers `TryGetValue` over the `Value` property when implementing p

### Union member providers

> [!NOTE]
> If an `IUnionMembers` interface is used, all union members must be defined on that interface.

A union type can delegate its union members to a nested `IUnionMembers` interface. When this interface is present, the compiler looks for `Create` factory methods instead of constructors:
Comment thread
BarionLP marked this conversation as resolved.
Outdated

:::code language="csharp" source="snippets/unions/MemberProvider.cs" id="MemberProvider":::
Expand Down
Loading