You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please consider implementing a new method that allows retrieving the description of an enum field when using the [Description] attribute. This feature is particularly useful when you do not have control over the API, and thus cannot switch from using [Description] to [Label] attributes for enum descriptions.
Example Use Case:
enumCompany{[Description("Apple, Inc.")]Apple=0,}// Proposed new method usagevardescription=Company.Apple.GetEnumDescription();// Should return "Apple, Inc."
Request Details:
Functionality: Add a method named GetEnumDescription or similar to FastEnum which returns the string value of the [Description] attribute associated with an enum value.
Purpose: To enable developers to easily access enum descriptions even when they cannot modify the enum definition to use alternative attributes like [Label].
Implementation Considerations:
The method should handle cases where no [Description] attribute is present, perhaps by returning the enum name or null.
Ensure the method works across different .NET versions if applicable.
Thank you.
The text was updated successfully, but these errors were encountered:
Description:
Please consider implementing a new method that allows retrieving the description of an enum field when using the
[Description]
attribute. This feature is particularly useful when you do not have control over the API, and thus cannot switch from using[Description]
to[Label]
attributes for enum descriptions.Example Use Case:
Request Details:
Functionality: Add a method named
GetEnumDescription
or similar to FastEnum which returns the string value of the[Description]
attribute associated with an enum value.Purpose: To enable developers to easily access enum descriptions even when they cannot modify the enum definition to use alternative attributes like
[Label]
.Implementation Considerations:
The method should handle cases where no
[Description]
attribute is present, perhaps by returning the enum name ornull
.Ensure the method works across different .NET versions if applicable.
Thank you.
The text was updated successfully, but these errors were encountered: