原文地址:http://www.cnblogs.com/RainbowInTheSky/p/4590508.html

     public static List<T> ToPagedList<T>(this IEnumerable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, int>> keySelector)
{
var itemList = allItems.Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}
public static List<T> ToPagedList<T>(this IEnumerable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, bool>> keySelector)
{
var itemList = allItems.Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}
public static List<T> ToPagedList<T>(this IEnumerable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, string>> keySelector)
{
var itemList = allItems.Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}
public static List<T> ToPagedList<T>(this IEnumerable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, DateTime>> keySelector)
{
var itemList = allItems.Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}
public static List<T> ToPagedList<T>(this IQueryable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, int>> keySelector)
{
var itemList = allItems.OrderBy(keySelector).Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}
public static List<T> ToPagedList<T>(this IQueryable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, bool>> keySelector)
{
var itemList = allItems.OrderBy(keySelector).Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}
public static List<T> ToPagedList<T>(this IQueryable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, string>> keySelector)
{
var itemList = allItems.OrderBy(keySelector).Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}
public static List<T> ToPagedList<T>(this IQueryable<T> allItems, int pageIndex, int pageSize, Expression<Func<T, DateTime>> keySelector)
{
var itemList = allItems.OrderBy(keySelector).Skip(pageSize * (pageIndex - )).Take(pageSize).ToList();
return itemList;
}

最新文章

  1. Java.web-application-development-environments-for-macosx
  2. 数据库同步工具HKROnline SyncNavigator SQL Server互同步MySQL
  3. 理解css中的line-height
  4. 支持正则或通配符的hashmap
  5. 从输入 URL 到页面加载完的过程中都发生了什么---优化
  6. Java 8 vs. Scala(二):Stream vs. Collection
  7. windows mobile 6.5 隐藏 左下角(左上角)的开始按钮 叉号关闭按钮
  8. IT定理:摩尔定理,安迪-比尔定理,反摩尔定理
  9. dephi中单击鼠标拖动窗口(使用WM_SYSCOMMAND)
  10. 最简单的入门github
  11. 第五章——定时器Timer序言
  12. cs231n spring 2017 lecture7 Training Neural Networks II 听课笔记
  13. js解决IE8不支持html5,css3的问题(respond.js 的使用注意)
  14. 使用Docker部署Spring boot项目
  15. Unity-批量修改Prefab上的属性
  16. php 默认保几位小数,末尾为0去掉
  17. web前端知识大纲:系列二 css篇
  18. vue 坑 checked 和v-model共用
  19. tp未验证内容-9
  20. urllib2 post请求方式,带cookie,添加请求头

热门文章

  1. 字符串处理:ABAP中的正则表达式
  2. CUBRID学习笔记 2 安装教程
  3. autofs实现nfs自动挂载
  4. hdu 5693 朋友 博弈
  5. mouseover和mouseenter的区别
  6. placeholder在ie浏览器里不显示的问题解决
  7. iOS - Swift Subscript 下标脚本
  8. iOS - ASIHTTPRequest 网络请求
  9. 5.7 C和C++的关系
  10. POJ 2418 各种二叉排序树