Enum.ToString return wrong value?

后端 未结 2 562
借酒劲吻你
借酒劲吻你 2020-12-19 13:01

I have a simple enum:

public enum MyEnum
{
    [Description(\"Zero\")]
    Zero,
    [Description(\"A positive number\")]
    Positive,
    [Description(\"An         


        
2条回答
  •  眼角桃花
    2020-12-19 13:38

    It happens because you have set reserved to 2. If you want to set values for your enums, you should do all or none.

提交回复
热议问题