Question: I'm looking to compare a value against a list and then set another variable based on this comparison.

My list is

```
1 = Red
4 = Blue
13 = Green

```

I could have a series of if statements but with a large list this looks messy

```
if (Type == 1)
{
    Name = "Red";
}
else if (Type == 4)
{
    Name = "Blue";
}
else if (Type == 13)
{
    Name = "Green";
}

```

What's an efficient and tidy way to achieve the same?

Answer: 
I think you need to use switch here:

```
switch (Type)
  {
      case 1:
          Name = "Red";
          break;
      case 4:
          Name = "Blue";
          break;
      case 13:
          Name = "Green";
          break;
  }

```
```
    class Program
    {
        public enum EnumDisplayStatus
        {
            Red = 1,
            Blue = 2,
            Yellow = 3,
            Orange = 4
        }
        static void Main()
        {
            int value = 3;
            EnumDisplayStatus enumDisplayStatus = (EnumDisplayStatus)value;
            string color = enumDisplayStatus.ToString();
            Console.Write(color);
        }
    }

```

Use enum and get string with this way that I showed.