Sep 23, 2009 15:40
Every time somebody try to google how to examine IQueryable or simply LINQ query result is empty people give crazy recommendations. Some advice to catch exception, others to perform Count (!). Just user Reflector and see what count does. That's 100% not a way to check if there are no results. There are two proper ways to examine sequence is empty is to call Any() or Aggregate().