How to retrieve the integer value of an enum?
- by Natrium
I have an enum
public enum Color
{
    Red = 0,
    Blue = 1,
    Yellow = 2
}
When I do this:
Color color = Color.Blue;
Console.Writeline(color.Value);
I want to see it's integer-value (1 in this case, but it outputs "Blue" instead.
How can I solve this?
I use .NET 3.5.