枚举类型转为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="@level">@leveldescript</option>
            }

 

posted on 2014-12-26 18:00  利利乐园  阅读(248)  评论(0编辑  收藏  举报