title: Combine expressions for Where statement
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1922497/how-do-i-combine-linq-expressions-into-one">How do I combine LINQ expressions into one?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>public bool IsUnique(params Expression&lt;Func&lt;Employee, bool&gt;&gt;[] properties)
  {
      var combinedProperties = Combine(properties);
      var rowCount = _session.QueryOver&lt;Employee&gt;().Where(combinedProperties).ToRowCountQuery().RowCount();
      return rowCount == 0;
  }
  
  Expression&lt;Func&lt;Employee, bool&gt;&gt; Combine(Expression&lt;Func&lt;Employee, bool&gt;&gt;[] properties)
  {
      ???
  }
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>var isUnique = _employeeRepository.IsUnique(x =&gt; x.FirstName == commandMessage.FirstName, x =&gt; x.LastName == commandMessage.LastName);
  </code></pre>
  
  <p>Is there a way of combining predicates with an AND operator?</p>