public async Task <PagedResultDto <YaeherUserPayment> > YaeherUserPaymentPage(YaeherUserPaymentIn YaeherUserPaymentInfo) { //初步过滤 var query = _repository.GetAll().OrderBy(a => a.CreatedOn).Where(YaeherUserPaymentInfo.Expression); //获取总数 var tasksCount = query.Count(); //获取总数 var totalpage = tasksCount / YaeherUserPaymentInfo.MaxResultCount; var YaeherUserPaymentList = await query.PageBy(YaeherUserPaymentInfo.SkipTotal, YaeherUserPaymentInfo.MaxResultCount).ToListAsync(); return(new PagedResultDto <YaeherUserPayment>(tasksCount, YaeherUserPaymentList.MapTo <List <YaeherUserPayment> >())); }
/// <summary> /// 输出模型 /// </summary> /// <param name="YaeherUserPaymentDto"></param> /// <param name="YaeherUserPaymentInfo"></param> public YaeherUserPaymentOut(PagedResultDto <YaeherUserPayment> YaeherUserPaymentDto, YaeherUserPaymentIn YaeherUserPaymentInfo) { Items = YaeherUserPaymentDto.Items; TotalCount = YaeherUserPaymentDto.TotalCount; TotalPage = YaeherUserPaymentDto.TotalCount / YaeherUserPaymentInfo.MaxResultCount; SkipCount = YaeherUserPaymentInfo.SkipCount; MaxResultCount = YaeherUserPaymentInfo.MaxResultCount; }
public async Task <IList <YaeherUserPayment> > YaeherUserPaymentList(YaeherUserPaymentIn YaeherUserPaymentInfo) { var YaeherUserPayments = await _repository.GetAllListAsync(YaeherUserPaymentInfo.Expression); return(YaeherUserPayments.ToList()); }