title: Conditional data annotation
body: <p>Is there a way to make a data annotation conditional?  I have a table <code>Party</code> where I store both organisations and persons.  If I'm adding an organisation I don't want the field <em>surname</em> to be required, but only if I'm adding a person.</p>
  
  <pre><code>public class Party
  {
      [Required(ErrorMessage = "{0} is missing")]
      [DisplayName("Your surname")]
      public object surname { get; set; }
  
      [DisplayName("Type")]
      public object party_type { get; set; }
      ...
  }  
  </code></pre>
  
  <p>I'd like a condition for the required data annotation of surname, something like:<br>
  <code>if (party_type=='P')</code> then surname is required, else the surname can be empty.  </p>
  
  <p><strong>EDIT</strong><br>
  If I have to move this validation to the controller, how would I do it there? How can I trigger the same error message from there?</p>