a question on how to add a "SELECT TOP" query in asp.net mvc3
var applicant = from s in applicantRepository.GetApplicant()
select s;
in my applicant there is i think 200,000 datas and i just want to select the top 50
is that possible? Thanks KUDOS! :)
To return the top 50 rows in any order
var applicant =
(from s in applicantRepository.GetApplicant()
select s).Take(50);
if you want to apply ordering, say there's a LastName field
var applicant =
(from s in applicantRepository.GetApplicant()
orderby s.LastName
select s).Take(50);