c# - Adding Select Top in a Statement from a controller of ASP.net MVC 3 -


a question on how add "select top" query in asp.net mvc3

            var applicant = s in applicantrepository.getapplicant()                        select s; 

in applicant there think 200,000 datas , want select top 50

is possible? kudos! :)

to return top 50 rows in order

var applicant =      (from s in applicantrepository.getapplicant()     select s).take(50); 

if want apply ordering, there's lastname field

var applicant =      (from s in applicantrepository.getapplicant()     orderby s.lastname     select s).take(50); 

Comments