/// <summary> /// 分页并获取数据结果实例集合。 /// </summary> /// <typeparam name="TResult">数据结果类型。</typeparam> /// <param name="selector">要应用于每个元素投影函数。</param> /// <param name="predicate">筛选表达式。</param> /// <param name="page">分页信息接口。</param> /// <param name="predicate">排序选择器数组。</param> /// <returns></returns> public virtual IPageOfItems <TResult> PageOfItems <TResult>(Expression <Func <TRecord, TResult> > selector, Expression <Func <TRecord, bool> > predicate, IPage page, params OrderSelector <TRecord>[] orderSelectors) { var totalRecord = Count(predicate); var safePage = PageUtil.GetSafePage(page); if (totalRecord == 0) { return(PageUtil.Empty <TResult>(safePage)); } // return(PageUtil.Items(totalRecord, safePage, BuildQueryable(predicate, safePage, orderSelectors).Select(selector).ToList())); }