title: Get DisplayAttribute attribute from PropertyInfo
body: <pre><code>class SomeModel
  {
      [Display(Name = "Quantity Required")]
      public int Qty { get; set; }
  
      [Display(Name = "Cost per Item")]
      public int Cost { get; set; }
  }
  </code></pre>
  
  <p>I'm trying to map the model into a list of <code>{ PropertyName, DisplayName }</code> pairs, but I've got stuck.</p>
  
  <pre><code>var properties 
      = typeof(SomeModel)
          .GetProperties()
          .Select(p =&gt; new 
              {
                  p.Name,
                  p.GetCustomAttributes(typeof(DisplayAttribute),
                                false).Single().ToString()
              }
          );
  </code></pre>
  
  <p>The above doesn't compile and I'm not sure it's the right approach anyway, but hopefully you can see the intent. Any pointers? Thanks</p>