Sajid Hussain

Sajid Hussain

  • 1.2k
  • 514
  • 100.6k

what is best alternate query for this one

Apr 24 2015 2:04 AM
i have a query that is full filling my requirement ,but problem is that when data in that table will increase then it will consume more time ,i want to alternate query in EF so that i will not get that chance. my query is as follow:
Hide Copy Code
 var ranks = _service.GetAllEmployeeDuty().OrderByDescending(x => x.EndDate)
.GroupBy(x => x.Employee_Id).Select(x => x.First()
).Where(x => x.ToSector_Id == sectorId).ToList();

Answers (1)