Skip to content

Instantly share code, notes, and snippets.

Created August 18, 2014 16:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
//Prepare test data. Could be a set returned
//from a database query
var list = new List<int>();
for (int i = 0; i < 1000000; i++)
//Prepare a list to hold the results
//E.g list of all users born a certain year
var listOfInts = new List<IEnumerable<int>>();
for (int i = 0; i < 10; i++)
//Select from the large list all users
//that satisfy the criteria
listOfInts.Add(list.Where(a => a == i));
//Now, loop through all years and select the
//first user for every year
foreach(var l in listOfInts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment