public IActionResult Delete(Guid Id) { try { _ObjetivoAlunoRepository.Remover(Id); return(Ok(Id)); } catch (Exception ex) { //Caso ocorra um erro retorna BadRequest return(BadRequest(ex.Message)); } }
public IActionResult Delete(Guid id) { try { var objetivoAl = objetivoAlunoRepository.Buscar(id); if (objetivoAl == null) { return(NotFound()); } objetivoAlunoRepository.Remover(id); return(Ok(id)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }