title: Use Include() method in repository
body: <p>I have the following with EF 5:</p>
  
  <pre><code>var a = context.Posts.Include(x =&gt; x.Pack).Select(x =&gt; x.Pack.Id).ToList();
  </code></pre>
  
  <p>This works. Then I tried to replicate this in my generic repository:</p>
  
  <pre><code>public IQueryable&lt;T&gt; Include&lt;T&gt;(Expression&lt;Func&lt;T, Boolean&gt;&gt; criteria) where T : class
  {
      return _context.Set&lt;T&gt;().Include(criteria);
  }
  </code></pre>
  
  <p>But in this case I am not able to do the following:</p>
  
  <pre><code>var b = repository.Include&lt;Post&gt;(x =&gt; x.Pack).Select(x =&gt; x.Pack.Id).ToList();
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'Data.Entities.Pack' to 'bool'</p>
  </blockquote>
  
  <p>How can I solve this? </p>
  
  <p>What should I change in my Include() method?</p>