title: ASP.NET Web API Help Page MetadataType Data Annotations
body: <p>Using data annotations with the help of MetadataTypeAttribute doesn't seem to be working with ASP.NET Web API Help Page. Not even sure if the data annotations actually work with MetadataTypeAttribute, but looks like it should... based on <a href="https://msdn.microsoft.com/en-us/library/ff664465(v=pandp.50).aspx" rel="nofollow noreferrer">this link</a>. We need to specify data annotations using different classes because the primary models are being used by other portable class libraries, in which these libraries cannot use the data annotations used with ASP.NET Web API.</p>
  
  <pre><code>[MetadataType(typeof(UserInfoMetadata))]
  public partial class UserInfoViewModel
  {
  }
  
  public class UserInfoMetadata
  {
      [Required]
      [Display(Name = "Email")]
      public string Email { get; set; }
  }
  </code></pre>
  
  <p>Looking at the sample model above, RequiredAttribute has been specified. That said, it should be displayed on the additional information column for the "Email" field or property. Specifying data annotations without using MetadataType attributes seem to be working fine.</p>