Trying to combine 2 linq expressions
<p>I have some queries over an Entity Framework model and am trying to be clever about consolidating my queries.</p>

<p>I already have a generic repository.</p>

<p>Here's the crux of what I'm trying to do - it doesn't work but I'm not sure why and how to fix it.</p>

<p>The second function in code works but there are a couple of issues in the first - I've included it so that you can get the gist of what I'm trying to do.</p>

<pre><code>    IEnumerable&lt;Product&gt; QueryLive(Expression&lt;Func&lt;Product, bool&gt;&gt; predicate)
    {
        var exp = new Expression&lt;Func&lt;Product, bool&gt;&gt;(x =&gt; x.IsLive);

        var combined = Expression.AndAlso(exp, predicate);

        return QueryPublished(combined);
    }

    IEnumerable&lt;Product&gt; QueryPublished(Expression&lt;Func&lt;Product, bool&gt;&gt; predicate)
    {
        using (var uow = new UnitOfWork(Connections.ProductComparision))
        {
            var r = new Repository&lt;Product&gt;(uow.Context);

            return r.Find(predicate).ToList();
        }
    }
</code></pre>

<p>I get 2 syntax errors:</p>

<p>Line: var exp = 'System.Linq.Expressions.Expression' does not contain a constructor that takes 1 arguments</p>

<p>Return: 'combined' var is a binary expression and conflicts with the param requirements of QueryPublished(). </p>