int value = 1;
string description = Enumerations.GetEnumDescription((MyEnum)value);
The default underlying data type for an enum
in C# is an int
, you can just cast it.
More Related Contents:
- How to declare enums in C#
- How can I cast int to enum?
- Convert a string to an enum in C#
- Enum “Inheritance”
- Can my enums have friendly names? [duplicate]
- C# vs Java Enum (for those new to C#)
- Non-unique enum values
- Enum String Name from Value
- How can I cast int to enum in C#?
- What is the tilde (~) in the enum definition?
- WPF Binding a ListBox to an enum, displaying the Description Attribute
- How to set enum to null
- Why enums require an explicit cast to int type?
- How to check if any flags of a flag combination are set?
- C# Iterating through an enum? (Indexing a System.Array)
- How do you pass multiple enum values in C#?
- How to convert a character in to equivalent System.Windows.Input.Key Enum value?
- How do I cast a generic enum to int?
- How to define an enum with string value?
- Enum to Dictionary in C#
- How to prevent duplicate values in enum?
- C# int, Int32 and enums
- Binding an enum to a WinForms combo box, and then setting it
- Enum to Dictionary in C#
- Total number of items defined in an enum
- Deserialize Dictionary with enum values in C#
- Choosing the default value of an Enum type without having to change values
- How to convert from System.Enum to base integer?
- Model Binding to Enums in ASP.NET MVC 3
- How can I use enum types in XAML?