title: Generate LINQ or Lambda Expression for Multiple columns based on the user selection of checkboxes
body: <p>I have a few checkboxes on top of my webpage which correspond to the columns of my Table. Like there is a column studentId then there will be a checkbox studentId and so on. I want to write such a linq/lamda expression for List which will filter the on the basis of the checkboxes selected. For example if selects studentId and studentType checkbox then linq/lambda expression should bring all the rows matching the selection.</p>
  
  <p>example:</p>
  
  <p>If studentId and studentType checked then:</p>
  
  <pre><code>foreach (Child c in SomeList)
  {
  if (chkStudentId.checked)
  {
   List.FindAll (h=&gt; h.StudentId == c.studentId);
  }
  if (chkStudentType.checked)
  {
   List.FindAll (h =&gt; h.StudentType == c.studentType)
  }
  }
  }
  </code></pre>
  
  <p>I can't figure out how am I going to write such a code that if user selects multiple checkboxes, the query should compare to all the columns and bring the values based only on the checkboxes checked. The above is only static and does not help. please help. Thanks.</p>