I want to return the TOP 100 records using Linq.
+15
A:
Use the Take extension method.
var query = db.Models.Take(100);
tvanfosson
2009-04-24 19:48:59
thanks! much appreciated..
jinsungy
2009-04-24 19:51:54
+6
A:
You want to use Take(N);
var data = (from p in people
select p).Take(100);
If you want to skip some records as well you can use Skip, it will skip the first N number:
var data = (from p in people
select p).Skip(100);
Lukasz
2009-04-24 19:49:37