public ActionResult Index(int idPag = 0) { try { _pagination.PaginaAtual = idPag; _pagination.QtdeItensPagina = 20; var entidade = _screenService.Get(_pagination); var model = Mapper.Map <IEnumerable <Screen>, IEnumerable <ScreenModel> >(entidade); var paginar = _pagination.CalculatePaging(_pagination, _screenService.Count()); ViewBag.PaginaAtual = paginar.PaginaAtual; ViewBag.QtdePaginas = paginar.QtdePaginas; return(View(model)); } catch (Exception e) { ShowMessageDialog(MensagensResource.ErroCarregar, e); return(RedirectToAction("Index", "Home")); } }