1
Answer

what is best alternate query for this one

Photo of Sajid Hussain

Sajid Hussain

10y
784
1
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)