title: Add data annotations to a class generated by entity framework
body: <p>I have the following class generated by entity framework:</p>
  
  <pre><code>public partial class ItemRequest
  {
      public int RequestId { get; set; }
      //...
  </code></pre>
  
  <p>I would like to make this a required field</p>
  
  <pre><code>[Required]
  public int RequestId { get;set; }
  </code></pre>
  
  <p>However, because this is generated code this will get wiped out.  I can't imagine a way to create a partial class because the property is defined by the generated partial class.  How can I define the constraint in a safe way?</p>