title: Validating property value, based on another model property
body: <p>I have a question regarding property validation, however, I haven't yet been able to find an appropriate answer.</p>
  
  <p>I have the following classes</p>
  
  <pre><code>public class IndexViewModel
  {
      public Film Film { get; set; }
  
      public ReviewModel Review { get; set; }
  }
  
  public class ReviewModel
  {
      [RequiredIf // only fire if 'Genre' is equal to Genre.Horror]
      public string Text { get; set; }
  }
  
  public class Film
  {
      public string Title { get; set; }
      public Director Director { get; set; }
      public Genre Genre { get; set; }
  }
  
  public class Director
  {
      public string Name { get; set; }
  }
  
  public enum Genre
  {
      Horror,
      Thriller,
      SciFi,
      Drama
  }
  </code></pre>
  
  <p>Is it possible to add a <code>[RequiredIf]</code> attribute on the <code>Text</code> property in <code>ReviewModel</code> which fires validation based on the value of <code>Genre</code> in the <code>Film</code> model. Any Help would be greatly appreciated.</p>