public JsonResult SelecionarEnderecos(int id) { var todosEnderecosViewModel = Mapper.Map <IEnumerable <Endereco>, IEnumerable <EnderecoViewModel> >(_enderecoAppServico.ObterTodos()); var enderecoViewModel = todosEnderecosViewModel.Where(e => e.MunicipioId == id).ToList(); return(Json(enderecoViewModel, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { var enderecoViewModel = Mapper.Map <IEnumerable <Endereco>, IEnumerable <EnderecoViewModel> >(_enderecoAppServico.ObterTodos()); return(View(enderecoViewModel)); }