Question: I have an enum that I'd like to display all possible values of. Is there a way to get an array or list of all the possible values of the enum instead of manually creating such a list? e.g. If I have an enum:

```
public enum Enumnum { TypeA, TypeB, TypeC, TypeD }

```

how would I be able to get a `List<Enumnum>` that contains `{ TypeA, TypeB, TypeC, TypeD }`?

Answer: 
This gets you a plain array of the enum values using [`Enum.GetValues`](http://msdn.microsoft.com/en-us/library/system.enum.getvalues.aspx):

```
var valuesAsArray = Enum.GetValues(typeof(Enumnum));

```

And this gets you a generic list:

```
var valuesAsList = Enum.GetValues(typeof(Enumnum)).Cast<Enumnum>().ToList();

```
Try this code:

```
Enum.GetNames(typeof(Enumnum));

```

This return a `string[]` with all the enum names of the chosen enum.