title: Linq pass null to Where clause
body: <p>I have method which accept expression for Linq Where clause. Sometimes I would like to ignore Where clause and do not use it.</p>
  
  <p>I have tried to pass null to the method like this</p>
  
  <pre><code>GetUsersView(null)
  </code></pre>
  
  <p>but got exception. How correctly do this?</p>
  
  <pre><code> private IQueryable&lt;UserView&gt; GetUsersView(Expression&lt;Func&lt;User, bool&gt;&gt; expression)
          {            
              return _userRepository.GetAll().
                                     Where(expression).
                                     Select(p =&gt; new UserView
                                     {
                                         Id = p.Id,
                                         Active = p.Orders.Any(c =&gt; c.Active &amp;&amp; (c.TransactionType == TransactionType.Order || c.TransactionType == TransactionType.Subscription)),
                                         DateStamp = p.DateStamp,
                                         Email = p.Email,
                                         FirstName = p.FirstName,
                                         LastName = p.LastName,
                                         Message = p.Message,
                                         UsersManager = p.Orders.Select(o =&gt; o.Product).Any(w =&gt; w.UsersManager &amp;&amp; w.Active)
                                     });
          }
  </code></pre>