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?
- JavaScriptSerializer – JSON serialization of enum as string
- Is it better to return null or empty collection?
- Merging dictionaries in C#
- Automatically create an Enum based on values in a database lookup table?
- Gradient Circles for Map Generator
- Collection versus List what should you use on your interfaces?
- ReadOnlyCollection or IEnumerable for exposing member collections?
- How do I cast int to enum in C#?
- Is there anything like asynchronous BlockingCollection?
- Static Generic Class as Dictionary
- Does List guarantee insertion order?
- How to TryParse for Enum value?
- .NET Enumeration allows comma in the last field
- Case insensitive access for generic dictionary
- Get dictionary value by key
- How to get around lack of covariance with IReadOnlyDictionary?
- C# List – Removing items while looping / iterating [duplicate]
- C# Enums: Nullable or ‘Unknown’ Value?
- Is it possible to create some IGrouping object
- Composite Key Dictionary
- C# Enum – How to Compare Value
- How to get random values from array in C# [duplicate]