C# 数组集合分页 Skip Take

var input=new input();

var personList= new List<Person>(); //一个查询集合
var Total = personList.Count(s => s.AcceptStatus == input.AcceptStatus);  //总记录数

//分页
var pagerList = personList.Where(s => s.AcceptStatus == input.AcceptStatus).OrderByDescending(s => s.CreateTime)

               .Skip((input.PageIndex-1)*input.PageSize).Take(input.PageSize).ToList();

 

//说明

Skip()方法先忽略根据页面的大小和实际的页数计算出的项数,
再使用方法Take()根据页面的大小提取一定数量的项
原文地址:https://www.cnblogs.com/chxl800/p/10491352.html