@using System.ComponentModel.DataAnnotations @model Enum @{ Func GetDisplayName = o => { var result = null as string; var display = o.GetType() .GetMember(o.ToString()).First() .GetCustomAttributes(false) .OfType() .LastOrDefault(); if (display != null) { result = display.GetName(); } return result ?? o.ToString(); }; } @GetDisplayName(ViewData.Model)