title: Linq Should I Return List<T> Or IEnumerable<T> When I Still May Do More Later
body: <p>I have some methods that return a List of T like say GetAllEvents.  In some cases I need to then filter that list of events (or whatever my List is) by date or some other property on the items.</p>
  
  <p>I know that LINQ queries can be "chained" or have x number of lines that further refine them and the query will not execute until some point when you need to actually use them in a non-linq statement (please correct me if I am wrong on this beliefe.)</p>
  
  <p>My question is, if my GetAllXXX method returns a List of whatever I am getting, is the .ToList() method I am using at the end of my GetAllXXX code executing the LINQ?  Should I return IEnumerable instead?  If only for those cases where I need to do something further to the "results" BEFORE the query is actually run.</p>
  
  <p>Here is an example of my worry:  I have say 1000 events.  The GetAllEvents will retrieve all 1000 and give me a List of them.  Then, depending on what page the user is on, may only show events for Today, this week or of a certain category.  Ideally, by the time it gets to the point where I am showing the user the 5 events happening today, I don't really want to pass all 1000 across the wire and then truncate that down to the 5 they really want.  Yes, I know it is all server side at this point, but if it is still allocating memory for the 1000 I am trying to avoid this.</p>
  
  <p>Any pointers or suggestions?</p>