title: How to enumerate through list of Func<TSource,TResult> to filter collection
body: <p>I'm trying, unsuccessfully, to enumerate through a <code>List&lt;Func&lt;InstagramUser,bool&gt;&gt;</code> to filter a collection of <code>List&lt;InstagramUser&gt;</code>. My code compiles, but just returns the whole list, unfiltered, when <code>display()</code> is invoked.</p>
  
  <p>My question is, what is the proper way to hold a collection of lambda expressions that can then be used to filter another collection?</p>
  
  <pre><code>public class InstagramDisplay {
      public IList&lt;InstagramUser&gt; instagramUsers;
      public IList&lt;Func&lt;InstagramUser, bool&gt;&gt; instagramFilters; 
  
      public InstagramDisplay() {
          instagramUsers = new List&lt;InstagramUser&gt;();
          instagramFilters = new List&lt;Func&lt;InstagramUser, bool&gt;&gt;();
      }
  
      public void addFilter(Func&lt;InstagramUser, bool&gt; filter, object filterValue) {
          if ((int)(filterValue ?? 0) &gt; 0)
              instagramFilters.Add(filter);
      }
  
      public IEnumerable&lt;InstagramUser&gt; display() { //filter not working
          instagramFilters.ToList().ForEach(filter =&gt; instagramUsers.Where(filter));
          return instagramUsers;
      }
  }
  </code></pre>
  
  <p>Invocation - just returns full collection, unfiltered:</p>
  
  <pre><code>InstagramDisplay instagramDisplay = new InstagramDisplay();
  instagramDisplay.instagramUsers = (List&lt;InstagramUser&gt;)context.Cache[CACHE_KEY];
  instagramDisplay.addFilter(u =&gt; u.id == instagramId, instagramId);
  context.Response.Write(javascriptSerializer.Serialize(instagramDisplay.display());
  </code></pre>