Exemplo n.º 1
0
        public IHttpActionResult Delete(int?id)
        {
            try
            {
                if (!id.HasValue)
                {
                    return(BadRequest());
                }

                Aluno aluno = _repositorioAlunos.SelecionarPorId(id.Value);

                if (aluno == null)
                {
                    return(NotFound());
                }

                _repositorioAlunos.ExcluirPorId(id.Value);
                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError());
            }
        }