纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

3 years ago
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace NFine.Code.Extend
  4. {
  5. public static class ExtList
  6. {
  7. /// <summary>
  8. /// 获取表里某页的数据
  9. /// </summary>
  10. /// <param name="data">表数据</param>
  11. /// <param name="pageIndex">当前页</param>
  12. /// <param name="pageSize">分页大小</param>
  13. /// <param name="allPage">返回总页数</param>
  14. /// <returns>返回当页表数据</returns>
  15. public static List<T> GetPage<T>(this List<T> data, int pageIndex, int pageSize, out int allPage)
  16. {
  17. allPage = 1;
  18. return null;
  19. }
  20. /// <summary>
  21. /// IList转成List<T>
  22. /// </summary>
  23. /// <typeparam name="T"></typeparam>
  24. /// <param name="list"></param>
  25. /// <returns></returns>
  26. public static List<T> IListToList<T>(IList list)
  27. {
  28. T[] array = new T[list.Count];
  29. list.CopyTo(array, 0);
  30. return new List<T>(array);
  31. }
  32. }
  33. }