public IActionResult Delete(int idAluguel) { try { var aluguelExistente = _aluguelRepositorio.Obter(idAluguel); if (aluguelExistente != null) { _aluguelRepositorio.Deletar(idAluguel); } else { return(StatusCode(StatusCodes.Status404NotFound, Constantes.Mensagens.AluguelNaoEncontrado)); } return(Ok()); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, Constantes.Mensagens.ServicoIndisponivel)); throw; } }