Get int value from enum in C#

前端 未结 28 2350
臣服心动
臣服心动 2020-11-22 04:58

I have a class called Questions (plural). In this class there is an enum called Question (singular) which looks like this.

public e         


        
28条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 05:21

    Try this one instead of convert enum to int:

    public static class ReturnType
    {
        public static readonly int Success = 1;
        public static readonly int Duplicate = 2;
        public static readonly int Error = -1;        
    }
    

提交回复
热议问题