private async Task <PaginationResult <PratoViewModel> > ObterPratos(PaginationParameter paginationParameter) { var pratos = _mapper.Map <List <PratoViewModel> >(await _pratoRepository.Paginacao(paginationParameter)); var totalItens = await _pratoRepository.TotalRegistros(); var totalPaginas = totalItens / paginationParameter.PageSize; return(new PaginationResult <PratoViewModel> { PageNumber = paginationParameter.PageNumber, TotalItens = totalItens, TotalPages = totalItens % paginationParameter.PageSize > 0 ? totalPaginas + 1 : totalPaginas, Data = pratos }); }