LINQ in Action roller

what's the difference between Enumerable.Select() and Enumerable.TakeWhile()???

what's the difference between Enumerable.Select() and Enumerable.TakeWhile()??? I read MSDN, but i can't quit clear. Another Quesiton: How can i return specified number of elements in LINQ? The following is my way, but i think maybe have better ones. Method 1. int[] list = new int[]{1,2,3,4,5,6,7,8,9,0,10,23,21,56,78,999}; int _index = 0; var query = from i in list where i > 5 order by i descending let index = _index++ where index < 2 select i; Method 2. int[] list = new int[]{1,2,3,4,5,6,7,8,9,0,10,23,21,56,78,999}; Read More...
Published Wednesday, May 23, 2007 1:46 AM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication