title: Is there a way for properties of a class to inherit the validation of the parent class?
body: <p>Say I have a class as follows</p>
  
  <pre><code>class Person {
      [Required]
      public string Firstname;
  
      [Required]
      public string Lastname;
  }
  
  class Record {
      [RequiredIfTrue("HasPerson")]
      public Person Person;
  
      [Required]
      public bool? HasPerson;
  }
  </code></pre>
  
  <p>then I have some view code</p>
  
  <pre><code>&lt;div showIfTrue("HasPerson")&gt;
      @Html.EditorFor(m =&gt; m.Person.Firstname);
      @Html.ValidationMessageFor(m =&gt; m.Person.Firstname);
      ...
  &lt;/div&gt;
  </code></pre>
  
  <p>My the fields should not fail to validate if <code>HasPerson</code> is false, but they do. Is there a way to write the models so this validates correctly?</p>
  
  <p>i.e. Is there a way for properties of a class to inherit the validation of the parent class?</p>