refactor this events.orderby(x => x.start) .select(x => x.start.date) .distinct() .take(20); in csharp

main.cs
events.OrderBy(x => x.start)
      .Select(x => x.start.date)
      .Distinct()
      .Take(20);
97 chars
5 lines

This code sorts a collection of "events" by their "start" date/time property, selects the "date" component of the "start" date/time property, returns only distinct dates, and finally takes the first 20 dates in the resulting sequence.

gistlibby LogSnag