I have the following enumerator.
public enum Fruits
{
Banana = 1,
Apple = 2,
Blueberry = 3,
Orange = 4
}
And what I'd like to do is something like the following
static void FruitType(int Type)
{
string MyType = Enum.GetName(Fruits, Type);
}
Basically I want the string MyType to populate with the name corresponding to the integer I input. So if I enter 1, MyType should have a value of Banana.
Eg. FruitType(1) --> MyType = Banana