title: Using a predicate to find all rows?
body: <p>I have the following code, I am using the repository pattern in EF 4.1 and Unit of Work.
  However because I dont understand very much how Expression and Predicates works I ask the following:</p>
  
  <p>With the code below, is there a better way to find all rows?</p>
  
  <pre><code>    public ActionResult Index()
      {
          var positions = unitOfWork.PositionRepository
                                    .Find(p =&gt; p.PositionID != null);
  
          return View(positions.ToList());
      }
  </code></pre>
  
  <p>I based my UnitofWork and Repository from here
  <a href="http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application" rel="nofollow">http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application</a></p>
  
  <p>I tried this:</p>
  
  <pre><code>public virtual List&lt;TEntity&gt; GetAll()
          {
              return context.Set&lt;TEntity&gt;.ToList();
          }
  </code></pre>