title: LINQ Conditional Where Clauses not working
body: <p>Using: MVC 5, C#, VS 2013, EF6 with CodeFirst, SQL Server 2012</p>
  
  <p>I have tried the four different ways to get the data without any issues. </p>
  
  <pre><code>IQueryable&lt;vw_Results&gt; qryResults = _db.vw_Results;
  </code></pre>
  
  <p>The problem I am encountering is that I have 13 filter options and the code for all 13 follow the same logic:</p>
  
  <pre><code>string fmVal = string.Empty;
  if (!string.IsNullOrEmpty(form["Locations"]))
  {
      fmVal = form["Locations"].ToString();
      qryResults = qryResults.Where(w =&gt; w.LOCATION.CompareTo(fmVal) == 0);
  }
  
  if (!string.IsNullOrEmpty(form["ddActionLevels"]))
  {
      //qryResults = qryResults.Where(w =&gt; w.PAL_ID==form["ddActionLevels"].ToString());
      vbVal = form["ddActionLevels"].ToString(); ;
      //qryResults = qryResults.Where(w =&gt; w.AL == vbVal);
      qryResults.Where(w =&gt; w.AL.CompareTo(vbVal) &gt;= 0);
  }
  
  if (!string.IsNullOrEmpty(form["btnGenericRpt"]))
  {
      qryResults.Where(w =&gt; w.LOCATION != "BB1");
  }
  
  if (!string.IsNullOrEmpty(form["ddProjects"]))
  {
      vbVal = form["ddProjects"].ToString();
      qryResults.Where(w =&gt; w.PROJECT == vbVal);
  }
  //...
  myModel.Results = qryResults.ToList();
  return View(myModel);
  </code></pre>
  
  <p>If I only provide 1 filter, I get the data that I want.  As soon as I provide more than 1 filter, I get the "Enumeration yielded no results" yet the data-set from the first filter does contain the data I am filtering on.</p>