title: Usage of "Expression<Func<Object, bool>>"
body: <p>please take a look at the following snippet:</p>
  
  <pre><code>public IEnumerable&lt;T&gt; Query(Expression&lt;Func&lt;T, bool&gt;&gt; filter)
  {
      return filter != null ? this.ObjectSet.Where(filter) : null;
  }
  </code></pre>
  
  <p>As for example:</p>
  
  <pre><code>public IQueryable&lt;Department&gt; Query(Expression&lt;Func&lt;Department, bool&gt;&gt; filter)
  {
      return _context.Departments.Where(filter);
  }
  </code></pre>
  
  <p>(original source: <a href="http://blogs.microsoft.co.il/blogs/gilf/archive/2010/06/21/revisiting-the-repository-and-unit-of-work-patterns-with-entity-framework.aspx" rel="nofollow">http://blogs.microsoft.co.il/blogs/gilf/archive/2010/06/21/revisiting-the-repository-and-unit-of-work-patterns-with-entity-framework.aspx</a>)</p>
  
  <p>Can anyone provide some concrete examples of how to go about actually calling the second method with an actual query?</p>
  
  <p>Thanks!</p>