/// <summary> /// 查找分页列表 /// </summary> /// <param name="pageSize">每页记录数。</param> /// <param name="pageIndex">页码。首页从1开始</param> /// <param name="totalNumber">总记录数</param> /// <param name="where">查询表达式</param> /// <param name="orderParam">排序【null-不设置】</param> /// <returns></returns> public IQueryable <T> FindPageList(int pageSize, int pageIndex, out int totalNumber, Expression <Func <T, bool> > where, OrderParam orderParam) { OrderParam[] _orderParams = null; if (orderParam != null) { _orderParams = new OrderParam[] { orderParam } } ; return(FindPageList(pageSize, pageIndex, out totalNumber, where, _orderParams)); }
/// <summary> /// 查找分页列表 /// </summary> /// <param name="pageSize">每页记录数。必须大于1</param> /// <param name="pageIndex">页码。首页从1开始,页码必须大于1</param> /// <param name="totalNumber">总记录数</param> /// <param name="where">查询表达式</param> public IQueryable <T> FindPageList(int pageSize, int pageIndex, out int totalNumber, Expression <Func <T, bool> > where) { OrderParam _param = null; return(FindPageList(pageSize, pageIndex, out totalNumber, where, _param)); }
//查询实体分页列表 #region FindPageList /// <summary> /// 查找分页列表 /// </summary> /// <param name="pageSize">每页记录数。必须大于1</param> /// <param name="pageIndex">页码。首页从1开始,页码必须大于1</param> /// <param name="totalNumber">总记录数</param> /// <returns></returns> public IQueryable <T> FindPageList(int pageSize, int pageIndex, out int totalNumber) { OrderParam _orderParam = null; return(FindPageList(pageSize, pageIndex, out totalNumber, _orderParam)); }
/// <summary> /// 查找分页列表 /// </summary> /// <param name="pageSize">每页记录数。必须大于1</param> /// <param name="pageIndex">页码。首页从1开始,页码必须大于1</param> /// <param name="totalNumber">总记录数</param> /// <param name="order">排序键</param> /// <param name="asc">是否正序</param> /// <returns></returns> public IQueryable <T> FindPageList(int pageSize, int pageIndex, out int totalNumber, OrderParam orderParam) { return(FindPageList(pageSize, pageIndex, out totalNumber, (T) => true, orderParam)); }
/// <summary> /// 查询实体列表 /// </summary> /// <param name="where">查询lambda表达式</param> /// <param name="number">获取的记录数量</param> /// <returns></returns> public IQueryable <T> FindList(Expression <Func <T, bool> > where, OrderParam orderParam) { return(FindList(where, orderParam, 0)); }