I have code that takes a parameter ulong, and using the mapping dictionary maps the ulong value to the value. However, the enumeration contains values that are the same for all purposes, so they are reassigned later in the enumeration in the same way as AfricanMangoin the following enumeration:
public enum Fruits
{
Banana = 0,
Strawberry,
Apple,
Peach,
Mango,
Berry,
AfricanMango = Mango,
Cranberry
}
This should tell the compiler to use the same values for AfricanMangoand Mangowhether this implementation really makes sense from a design point of view up.
My code converted the input to an enumeration value just fine, and when evaluating the result of a function, it returned Fruits.Cranberry. That was the value that I was expecting.
( Fruits.Cranberry), Fruits.Berry, , :
var fruit = Fruits.Cranberry;
Console.WriteLine(fruit);
, Cranberry, , , Berry.
? AfricanMango - ?