Example #1
0
        public static MvcHtmlString DisplayForEnum <TEnum>(this HtmlHelper htmlHelper, TEnum value)
        {
            var text = EnumExtension.GetDisplay <TEnum>(value);

            return(new MvcHtmlString(text));
        }
Example #2
0
        public static SelectList ToSelectList <TEnum>()
        {
            IEnumerable values = EnumExtension.ToList <TEnum>();

            return(new SelectList(values, "Value", "Text"));
        }