コード例 #1
0
 public async Task <IActionResult> Delete(int alunoId)
 {
     try
     {
         if (await alunoService.DeleteAlunoAsync(alunoId))
         {
             return(Ok());
         }
         return(BadRequest());
     }
     catch (KeyNotFoundException)
     {
         return(NotFound());
     }
     catch (Exception ex)
     {
         return(BadRequest($"Erro: {ex.Message}"));
     }
 }