public ActionResult Edit(AlunoViewModel aluno)
        {
            if (ModelState.IsValid)
            {
                var alunoDomain = Mapper.Map <AlunoViewModel, Aluno>(aluno);
                _alunoApp.Update(alunoDomain);

                return(RedirectToAction("Index"));
            }
            return(View(aluno));
        }
예제 #2
0
        public ActionResult Edit(int id, AlunoViewModel alunoViewModel)
        {
            if (ModelState.IsValid)
            {
                var aluno = Mapper.Map <Aluno>(alunoViewModel);

                _alunoAppService.Update(aluno);

                return(RedirectToAction("Index"));
            }

            return(View());
        }