public async Task <IActionResult> ExcluirAluno(int id)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _alunoService.ExcluirAluno(id);

                    return(Ok());
                }
                else
                {
                    return(BadRequest(ModelState));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
示例#2
0
 public bool Deletar(int id)
 {
     return(AlunoService.ExcluirAluno(id));
 }