我一直在寻找代码,如果我可以分页EF中的大数据,例如从1到100 ...或更多,Web应用程序真的很慢。 我在这里有代码,但我还找不到解决方案。实体框架分页
我真的需要使页面中的数据或使数据视图更快 记录超过(1,5000,000)记录。 请大家如果有人有EF分页的任何代码或解决方案或数据可以更快地回复我。
谢谢你们,
[代码]
var openComplaintsAssignedToOffice = individual.Office.AssignedComplaints
.ToArray()
.Where(n => n.Individuals.Any(e => e.Employed))
.ToArray() ;
if (!complaintModel.ShowClosedComplaints)
{
openComplaintsAssignedToOffice = openComplaintsAssignedToOffice.Where(c => c.CurrentStatus != ComplaintStatus.Closed)
.ToArray();
}
complaintModel.OpenComplaintsAssignedToMyOffice = openComplaintsAssignedToOffice.OrderByDescending(c => c.UpdatedDateTime)
.ToArray();
complaintModel.OpenComplaintsAssignedToMyOffice = openComplaintsAssignedToOffice.OrderByDescending(c => c.UpdatedDateTime)
.ToArray();
return complaintModel;
你只是寻找'.Skip()'和'。取()'功能? – David
你正在提出一个非常微不足道的问题,并附带代码,这些代码似乎并不相关。或者,更确切地说,代码似乎会导致问题本身。 –
http://sqlperformance.com/2015/01/t-sql-queries/pagination-with-offset-fetch – ErikEJ