public async Task <IActionResult> Delete(int id) { try { var solicitacao = await SolicitacaoService.GetSolicitacaobyIdAsync(id); if (solicitacao == null) { return(NoContent()); } return(await SolicitacaoService.DeleteSolicitacao(id) ? Ok(new { messagem = "Deletado" }) : throw new Exception("Ocorreu um problem não específico ao tentar deletar Solicitacao.")); } catch (Exception ex) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Erro ao tentar deletar eventos. Erro: {ex.Message}")); } }