title: ASP.NET MVC. How disable required validation based on a parameter?
body: <p>I do have a entity class with some required attributes depending of a selector.</p>
  
  <p>For instance: The Selector can assume "1" or "2". If selector was "1", a group of parameters shall be required. If selector is "2" another set of parameters is required.</p>
  
  <pre><code>class MyClass{
  
      public int Selector {get;set;} // 1 or 2
  
      public string A_required_for_1 {get;set;}
      public string B_required_for_1 {get;set;}
  
      public string C_required_for_2 {get;set;}
      public string D_required_for_2 {get;set;}
  
      public string E_Required_for_both_selectors {get;set;}
  
  }
  </code></pre>
  
  <p>User should be able to switch between selectors during Create or Edit actions in view. </p>
  
  <p>Client validation is already solved.</p>
  
  <p>How can I deal with it in server validation?</p>