title: How to chain OR clauses, with LINQ?
body: <p>I've got a scenario where I need to build a SQL query, using LINQ, that includes a variable amount of OR clauses. I'm writing a function that will build the query based on some input. The function definition looks something similar to ...</p>
  
  <pre><code>function BuildQuery(ICollection&lt;ColumnsThatNeedToBeTrue&gt; columns)
  {
    ...
  }
  </code></pre>
  
  <p>So, I'm given a collection of columns that I need to check for true, and the check needs to use <code>OR</code> clauses.</p>
  
  <p>If the <code>columns</code> array contains <code>A</code> and <code>B</code>, I'd need the query to check if column <code>A</code> is true OR column <code>B</code> is true.</p>
  
  <p>If the <code>columns</code> array contains <code>A</code>, <code>B</code> and <code>C</code>, I'd need to query and check if <code>A</code> OR <code>B</code> OR <code>C</code> are true.</p>
  
  <p>I don't know how to do this all within a single <code>Where</code>, because I don't know of a way to progressively tack on additional <code>||</code> clauses. I'm not sure how I'd include additional OR checks in the below, based on the input array.</p>
  
  <pre><code>var query = entities.Where(m =&gt; m.A == true || m.B == true ...)
  </code></pre>
  
  <p>I cannot chain <code>Where</code> functions, each for their own column check, because it builds that query using <code>AND</code> clauses and I need <code>OR</code>.</p>
  
  <p>Is there a way to build out a query like this, using LINQ?</p>