首页 > 其他分享 >调用接口,分批方法:

调用接口,分批方法:

时间:2022-12-10 16:05:25浏览次数:42  
标签:调用 pageSize views 分批 List 接口 list num double

调用接口,分批方法:

double num = Math.Ceiling((double)views.Count / (double)pageSize);
List<List<TViewModel>> list = new List<List<TViewModel>>();
for (int i = 0; (double)i < num; i++)
{
List<TViewModel> item = views.Skip(i * pageSize).Take(pageSize).ToList();
list.Add(item);
}

return list;



标签:调用,pageSize,views,分批,List,接口,list,num,double
From: https://blog.51cto.com/u_15310950/5927708

相关文章