using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace iWareCommon.Utils
{
///
/// 分页帮助类
///
public class PageHelper
{
///
/// 分页
///
///
///
/// 每页显示条数
/// 第几页
///
public static List Page(IQueryable source, int PageNum, int PageIndex) where TEntity : class
{
List list = new List();
int count = PageNum * (PageIndex - 1);
list = source.Skip(count).Take(PageNum).ToList();
return list;
}
///
/// 分页
///
///
///
/// 每页显示条数
/// 第几页
///
public static List Page(IList source, int PageNum, int PageIndex) where TEntity : class
{
List list = new List();
int count = PageNum * (PageIndex - 1);
list = source.Skip(count).Take(PageNum).ToList();
return list;
}
}
}