public async Task <IList <ReleaseManage> > ReleaseManageList(ReleaseManageIn ReleaseManageInfo)
        {
            //初步过滤
            var ReleaseManages = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(ReleaseManageInfo.Expression);

            return(await ReleaseManages.ToListAsync());
        }
Example #2
0
 /// <summary>
 /// 输出模型
 /// </summary>
 /// <param name="ReleaseManageDto"></param>
 /// <param name="ReleaseManageInfo"></param>
 public ReleaseManageOut(PagedResultDto <ReleaseManage> ReleaseManageDto, ReleaseManageIn ReleaseManageInfo)
 {
     Items          = ReleaseManageDto.Items;
     TotalCount     = ReleaseManageDto.TotalCount;
     TotalPage      = ReleaseManageDto.TotalCount / ReleaseManageInfo.MaxResultCount;
     SkipCount      = ReleaseManageInfo.SkipCount;
     MaxResultCount = ReleaseManageInfo.MaxResultCount;
 }
        public async Task <PagedResultDto <ReleaseManage> > ReleaseManagePage(ReleaseManageIn ReleaseManageInfo)
        {
            //初步过滤
            var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(ReleaseManageInfo.Expression);
            //获取总数
            var tasksCount = query.Count();
            //获取总数
            var totalpage         = tasksCount / ReleaseManageInfo.MaxResultCount;
            var ReleaseManageList = await query.PageBy(ReleaseManageInfo.SkipTotal, ReleaseManageInfo.MaxResultCount).ToListAsync();

            return(new PagedResultDto <ReleaseManage>(tasksCount, ReleaseManageList.MapTo <List <ReleaseManage> >()));
        }