public async Task <ActionResult> GetAllTimes([FromQuery] ParametersPage parametersPage) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var back = await _timeAppService.GetAll(parametersPage); var result = _mapper.MapList <TimeEntity, TimeViewModel>(back); var metadata = new { result.TotalCount, result.PageSize, result.CurrentPage, result.TotalPages, result.HasNext, result.HasPrevious }; Response.Headers.Add("X-Pagination", JsonConvert.SerializeObject(metadata)); return(Ok(result)); } catch (ArgumentException ex) { return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message)); } }
public SequenceParameterPages(BinaryReader bReader) { numberOfPages = bReader.ReadInt32(); parametersPage = new ParametersPage[numberOfPages]; for (int i = 0; i < numberOfPages; i++) { parametersPage[i] = new ParametersPage(bReader); } }
public async Task <IEnumerable <T> > SelectAsync(ParametersPage parametersPage) { return(await _dataset.Where(x => !x.isDeleted).Skip((parametersPage.PageNumber - 1) * parametersPage.PageSize) .Take(parametersPage.PageSize).AsNoTracking(). ToListAsync()); }
public async Task <PagedList <T> > SelectPaged(ParametersPage parametersPage) { return(await Task.FromResult(PagedList <T> .ToPagedList(_dataset.Where(x => !x.isDeleted).AsNoTracking(), parametersPage.PageNumber, parametersPage.PageSize))); }
public async Task <PagedList <CampeonatoEntity> > GetAll(ParametersPage parametersPage) { return(await _repository.SelectPaged(parametersPage)); }
public async Task <PagedList <TimeEntity> > GetAll(ParametersPage parametersPage) { return(await _timeService.GetAll(parametersPage)); }
public new async Task <IEnumerable <TimeEntity> > SelectAsync(ParametersPage parametersPage) { var result = await base.SelectAsync(parametersPage); return(result.OrderBy(x => x.nome)); }
public async Task <PagedList <CampeonatoEntity> > GetAll(ParametersPage parametersPage) { return(await _campeonatoService.GetAll(parametersPage)); }