Try:
var dict = Enum.GetValues(typeof(fooEnumType))
.Cast<fooEnumType>()
.ToDictionary(t => (int)t, t => t.ToString() );
More Related Contents:
- Enum to Dictionary in C#
- .NET HashTable Vs Dictionary – Can the Dictionary be as fast?
- Dictionary returning a default value if the key does not exist [duplicate]
- Multi Value Dictionary?
- Why doesn’t Dictionary support null key? [duplicate]
- Does C# have a way of giving me an immutable Dictionary?
- Recreating a Dictionary from an IEnumerable
- What benefits does dictionary initializers add over collection initializers?
- How to declare enums in C#
- Collection was modified; enumeration operation may not execute
- Convert List to List
- Enum “Inheritance”
- How to get C# Enum description from value? [duplicate]
- Serialize Class containing Dictionary member
- Select N random elements from a List in C#
- ASP.NET MVC Binding to a dictionary
- ObservableCollection that also monitors changes on the elements in collection
- Get dictionary key by value
- Duplicate keys in .NET dictionaries?
- What .NET collection provides the fastest search
- How do I override List’s Add method in C#?
- C# Sortable collection which allows duplicate keys
- Enum.GetValues() Return Type
- Why do C# collection initializers work this way?
- Binding DataGrid to ObservableCollection
- Sorting a Dictionary in place with respect to keys
- Does the Enumerator of a Dictionary return key value pairs in the order they were added?
- Reverse Sorted Dictionary in .NET
- How to sort a dictionary by key
- How add or remove object while iterating Collection in C#