Exemplo n.º 1
0
 public IActionResult Put(int id, [FromBody] Aluno aluno)
 {
     try
     {
         _repo.AlterarAluno(aluno);
         return(Ok(_repo.SelecionarTudo()));
     }
     catch (System.Exception)
     {
         return(StatusCode(500));
     }
 }
Exemplo n.º 2
0
        public IActionResult Put(int id, [FromBody] Aluno aluno)
        {
            try
            {
                _repoAluno.AlterarAluno(aluno);
                List <Aluno> alunos = _repoAluno.SelecionarTudo();

                return(Ok(_mapper.Map <IEnumerable <AlunoDto> >(alunos)));
            }
            catch (System.Exception)
            {
                return(StatusCode(500));
            }
        }