title: EF dbContext IQueryable methods dependencies not working
body: <p>I've tried to add a few helper methods to my dbContext class like this</p>
  
  <pre><code>public IQueryable&lt;Tool&gt; GetAllToolsInCompanyGroup(string userName)
  {
      var user = GetUserByName(userName);
      return Tools.Where(t =&gt; Companies.Any(c =&gt; user.Company.CompanyGroupId == c.CompanyGroupId &amp;&amp; c.Id == t.CompanyId));
  }
  </code></pre>
  
  <p>But if I call that from my controller I get this exception:</p>
  
  <pre><code>Unable to create a constant value of type 'myNamespace.Models.Company'. Only primitive types or enumeration types are supported in this context.
  </code></pre>
  
  <p>If i do the exact same thing in in my controller like this:</p>
  
  <pre><code>db.Tools.Where(t =&gt; db.Companies.Any(c =&gt; user.Company.CompanyGroupId == c.CompanyGroupId &amp;&amp; c.Id == t.CompanyId))
  </code></pre>
  
  <p>it works. What am I doing wrong?</p>