public Task <GetReportListResponseDto> GetReportListAsync(GetReportListRequestDto dto) { return(Task.Run(() => { var reportsList = _commentReportRepository.TableNoTracking.Where(t => t.AuditStatus.Equals(Communiry.Entity.Comment.AuditStatusEnum.pending.ToString())) .OrderByDescending(t => t.GMTCreate) .Skip(dto.start) .Take(dto.length).ToList(); GetReportListResponseDto resp = new GetReportListResponseDto(); resp.data = Mapper.Map <List <ReportDto> >(reportsList); resp.total = _commentReportRepository.TableNoTracking.Count( t => t.AuditStatus.Equals(Communiry.Entity.Comment.AuditStatusEnum.pending.ToString())); return resp; })); }
public async Task <IHttpActionResult> Get([FromUri] GetReportListRequestDto dto) { GetReportListResponseDto resp = await _commentService.GetReportListAsync(dto); return(Ok(resp)); }