Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
C#
from n in dc.Jobs
                        .OrderBy(o => o.LocationName==location1)
                        .Take(take)
                        .Skip(pageSize)
                        select new
                        {
                             Title = n.Title,

                              Name = n.CompanyName,
                              LName=n.LocationName,
                              Description=n.JobDescription,
                              Count = dc.Jobs.Count()
};




I had written the query for pagination but it is loading all the records from the database,i want to load the records related to location1 value plz help me how to modify the query am new to entity framework
Posted

1 solution

You need to add where condition
C#
from n in dc.Jobs
    .Where(o => o.LocationName==location1)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900