Thursday, July 21, 2011

Linq Query Take and Skip Extension Methods

var query=(from...
where...
select new {...}).Take(3);

Select the Top 3 elements.

var query=(from...
where...
select new {...}).Skip(2).Take(3);

Select the elements from 3 to 5. (Skip first 2, then select 3)

No comments: