public ActionResult Index() { var viewModel = new BancoIndexViewModel(); viewModel.Bancos = Mapper.Map <List <BancoViewModel> >(_bancoNegocio.ListarTodos()); return(View(viewModel)); }
public IActionResult Index(int?codigoCompensacao, string nome, int pageNumber = 1, int pageSize = 20) { var codigoCompensacaoSpecification = new BancoCodigoCompensacaoSpecification(codigoCompensacao); var nomeSpecification = new BancoNomeSpecification(nome); var list = _bancoApplicationService.Get(codigoCompensacaoSpecification .And(nomeSpecification) .ToExpression()); var viewModel = new BancoIndexViewModel { Bancos = list.ToPagedList(pageNumber, pageSize), CodigoCompensacao = codigoCompensacao, Nome = nome, }; return(View(viewModel)); }