public async Task <IActionResult> Delete(int id) { try { var _curso = await cursoRepo.Select(id); if (_curso.Id == 0) { return(NotFound(new { message = "Não encontrado" })); } await cursoRepo.Delete(id); return(StatusCode(StatusCodes.Status200OK)); } catch (Exception ex) { return(StatusCode(500, new { message = ex.Message })); } }