public async Task <IList <ArticleOperList> > ArticleOperListList(ArticleOperListIn ArticleOperListInfo) { //初步过滤 var ArticleOperLists = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(ArticleOperListInfo.Expression); return(await ArticleOperLists.ToListAsync()); }
public async Task <PagedResultDto <ArticleOperList> > ArticleOperListPage(ArticleOperListIn ArticleOperListInfo) { //初步过滤 var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(ArticleOperListInfo.Expression); //获取总数 var tasksCount = query.Count(); //获取总数 var totalpage = tasksCount / ArticleOperListInfo.MaxResultCount; var ArticleOperListList = await query.PageBy(ArticleOperListInfo.SkipTotal, ArticleOperListInfo.MaxResultCount).ToListAsync(); return(new PagedResultDto <ArticleOperList>(tasksCount, ArticleOperListList.MapTo <List <ArticleOperList> >())); }
/// <summary> /// 输出模型 /// </summary> /// <param name="ArticleOperListDtos"></param> /// <param name="ArticleOperListInfo"></param> public ArticleOperListOut(PagedResultDto <ArticleOperList> ArticleOperListDtos, ArticleOperListIn ArticleOperListInfo) { Items = ArticleOperListDtos.Items; TotalCount = ArticleOperListDtos.TotalCount; TotalPage = ArticleOperListDtos.TotalCount / ArticleOperListInfo.MaxResultCount; SkipCount = ArticleOperListInfo.SkipCount; MaxResultCount = ArticleOperListInfo.MaxResultCount; }