public async Task <PagedResultDto <Log> > GetAll(QueryLogFilter filter) { var result = new PagedResultDto <Log>(); var query = await _logRepository.GetAllByAsync(); result.TotalCount = query.Count(); result.Items = query.OrderByDescending(x => x.Logged).Skip(filter.limit * (filter.page - 1)).Take(filter.limit).ToList(); return(result); }
public async Task <PagedResultDto <LogDto> > GetAll(QueryLogFilter filter) { var result = new Base.PagedResultDto <LogDto>(); var categorys = await _logService.GetAll(filter); result.Items = _mapper.Map <List <LogDto> >(categorys.Items); result.TotalCount = categorys.TotalCount; return(result); }
public async Task <JsonResult> GetList() { QueryLogFilter filter = new QueryLogFilter(); filter.limit = int.Parse(Request.Query["limit"]); filter.page = int.Parse(Request.Query["page"]); var result = await _logAppService.GetAll(filter); OutputModel outputModel = new OutputModel(); outputModel.Data = result; return(new JsonResult(outputModel)); }