title: Data Annotations Checkbox
body: <p>Is there a way to validate bool checkboxes using Data Annotations in C# MVC?</p>
  
  <p>All the examples I have seen for the custom data annotation approach are just validating one checkbox like a Accept Terms box. I need to validate that at least one checkbox has been selected in a List&lt;></p>
  
  <p>For Example:</p>
  
  <pre><code>public class QuestionOptionViewModel
  {
      public int? Id { get; set; }
  
      public string Text { get; set; }
  
      public string QuestionType { get; set; }
  
      [RequiredIf("QuestionType", "text", ErrorMessage = "Required Field")]
      public string Value { get; set; }
  
      [RequiredIf("QuestionType", "checkbox", ErrorMessage = "Required Field")]
      public bool IsChecked { get; set; }
  }
  </code></pre>
  
  <p>I am storing a list of IsChecked. I wanted to know rather one of the Checkboxes in the list was selected using Data Annotations. </p>