title: Generic Repository GetAll Filter Does not filter
body: <p>I have a generic method that is supposed to return a IEnumerable of anything. In addition, the user has the option to filter out the return list. The issue I am having is that the list is not being filtering. For example, I am trying to get a list of users from the database; I calling the method using this syntax</p>
  
  <pre><code>var users = unit.UserRepository.GetAll(x =&gt; x.UserName == username);
  </code></pre>
  
  <p>I was expected one users, but it returns all the users in the database. </p>
  
  <p>Here is my generic method:</p>
  
  <pre><code> public IEnumerable&lt;TEntity&gt; GetAll(Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter =null, 
               Func&lt;IQueryable&lt;TEntity&gt;, IOrderedQueryable&lt;TEntity&gt;&gt; orderby = null, string property = "")
           {
               IQueryable&lt;TEntity&gt; query = dbSet;
               if (filter != null)
               {
                   query.Where(filter);
               }
  
               if (property != null)
               {
                   foreach (var p in property.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                   {
                       query = query.Include(p);
                   }
               }
  
               if(orderby != null)
               {
                   return orderby(query);
               }  else
               {
                     return query.ToList();
               }
           }
  </code></pre>
  
  <p>IS there something that I am missing here?</p>