Adding Descriptions to Enumeration Constants
Descriptions for members of an enumeration can be added using an attribute:
Usage:
Notice that this way to add a string representation of the enumeration constants is inflexible and hard to localize.
The names of enumeration constants can be extracted by either Enum.GetNames
or the enumeration members’ ToString
method: Enumeration format strings – Microsoft Docs.