king枚举帮助类

可以方便的实现枚举

枚举
public enum DeptType
    {
        [Description("科室1")]
        Professional = 1,

        [Description("科室2")]
        Administrative = 2,

        [Description("科室3")]
        Quality = 3,

        [Description("其他")]
        Other = 4
    }


将枚举变为list
var list=King.EnumHelper.EnumTools.EnumToList<DeptType>();

要获取描述
1、var status=1;
(DeptType)status.Description();
2、DeptType type
type.Description();


 

posted on 2018-01-04 14:46  菜鸟客栈  阅读(119)  评论(0编辑  收藏  举报

导航