title: Data Annotations not showing for partial Entity classes in MVC 4
body: <p>I have seen dozens of explanations of how to add metadata annotations, via partial classes, to classes generated via Entity Framework, <strong>database first</strong>.  </p>
  
  <p>Can someone tell me why these new display values are not showing in my views?  Both of these are part of the same namespace as my entity framework generated classes.</p>
  
  <pre><code>[MetadataType(typeof(xRef_CodesMetadata))]
          public partial class xRef_Codes
          {
          }
  
  public class xRef_CodesMetadata
      {
          public int CodeID { get; set; }
          public int CTB_ID { get; set; }
  
          [Required(ErrorMessage = "Please type a name")]
          [Display(Name = "Code Name")]
          [Column(TypeName = "Code Name")]
          public string CodeName { get; set; }
  
          [Required(ErrorMessage = "Please type a Description")]
          [Display(Name = "Description")]
          [Column(TypeName = "Description")]
          public string Description { get; set; }     
      }
  </code></pre>
  
  <p>Fragment of View:</p>
  
  <pre><code>&lt;th&gt;
      @Html.DisplayNameFor(model =&gt; model.OfCodeID)
  &lt;/th&gt;
  &lt;th&gt;
      @Html.DisplayNameFor(model =&gt; model.CodeName)
  &lt;/th&gt;
  &lt;th&gt;
      @Html.DisplayNameFor(model =&gt; model.Description)
  &lt;/th&gt;   
  </code></pre>