I am using Linq to entities and would like to know if I can get a limited number of records when i query. I just need the top N records as the query do the orderby and other clauses. Is this possible or I will have to get the top N using foreach loop?
There are multiple ways
var data = (from p in db.people orderby p.IdentityKey descending select p).Take(100);
var query = db.Models.Take(100);
3) or you can skip certain results
var data = (from p in people select p).Skip(100);