首页 > 代码库 > 枚举类型转为list

枚举类型转为list

  var levelList = EnumEx.GetIntValues(CarConst.CustomCarType.Bus.GetType());            foreach (var level in levelList)            {                var en = (CarConst.CustomCarType)level;                var leveldescript = ((en).GetAttribute<DescriptionAttribute>()).Description;                <option value=http://www.mamicode.com/"@level">@leveldescript</option>            }

 

枚举类型转为list