调用接口,分批方法:

调用接口,分批方法:

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;

posted @ 2022-12-06 11:46  大树2  阅读(64)  评论(0编辑  收藏  举报