title: Linq to object dynamic query is it possible?
body: <p>Wondering if it's possible to create a dynamic linq query using linq to objects.</p>
  
  <p>I have a screen where a user can filter on multiple things.
  I Need to build an in memory filtering NOT using a database</p>
  
  <p>So lets suppose I have a list of customers in memory and I would like to filter based on some multiselection.</p>
  
  <p>I thought a method that I could pass a predicate would do the trick ,but obviously not.</p>
  
  <p>How can I do it?</p>
  
  <p>eg  </p>
  
  <pre><code>public class Biz
  {
      public List&lt;Customer&gt; GetAllByName(string name)
      {
          return Repository.Find(x=&gt; x.Name == name);
      }
  }
  
  public class Repository
  {
      private List&lt;Customer&gt; internalCustomerList = GetAllCustomers();
  
      public IEnumerable&lt;Customer&gt; Find(Expression&lt;Func&lt;T, bool&gt;&gt; predicate)
      {
          //How do I make below work in linq to object
          return  internalCustomerList.Where(predicate);//error here
      }
  }
  </code></pre>