EnumStringRepresentationExtensionsToStringRepresentationTEnum Method (TEnum) |
Converts the enum value to it's string representation.
Namespace: CMS.HelpersAssembly: CMS.Helpers (in CMS.Helpers.dll) Version: 12.0.0
Syntax public static string ToStringRepresentation<TEnum>(
this TEnum value
)
where TEnum : struct, new(), IConvertible, IComparable, IFormattable
Parameters
- value
- Type: TEnum
Enum value
Type Parameters
- TEnum
- Enum type
Return Value
Type:
String
Returns the string representation of the enum value if it is specified using the
EnumStringRepresentationAttribute.
Otherwise returns the enum field name.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also