title: Trying to Display "Name" attribute from an Enum in a View
body: <p>I am trying to retrieve the <code>[Display]</code> text below for whichever enum is saved in the database (i.e., if None, then corresponding is "No thanks.") without having to code an <code>@if</code> block in my view. I guess it's not possible, but thought I would ask.</p>
  
  <pre><code>public enum MyEnum
  {
      [Display(Name = "No thanks.")]
      None,
      [Display(Name = "Yes, send me your 100 Packet.")]
      100Packet,
      [Display(Name = "Yes, send me your 200 Packet.")]
      200Packet
  }
  </code></pre>
  
  <p>Right now, the only solution I have is to do this in my view:</p>
  
  <pre><code>@Model.MyEnumRadioButton // displays saved item in DB (i.e., "100Packet")
  
  @if (Model.MyEnumRadioButton == MyEnum.None)
  {
      &lt;text&gt;No thanks.&lt;/text&gt;
  }
  ....
  </code></pre>
  
  <p>and repeat that for each item in the <code>enum</code>. For this small example it's no big deal, but I have a lot of different <code>enum</code>'s, some with up to 10 choices.</p>
  
  <p>For example, is there something I can do with the <code>@Model.MyEnumRadioButton</code> to make it display the text?</p>
  
  <p>Any thoughts? Thanks in advance.</p>