public async Task <ActionResult> Delete(int Id) { try { var evento = await _eventoRepository.GetEventoAsyncById(Id, false); if (evento == null) { return(NotFound()); } _eventoRepository.Delete(evento); if (await _eventoRepository.SaveChangesAsync()) { return(Ok(new { success = "Excluído com sucesso!" })); } } catch (System.Exception) { return(this.StatusCode(500, "Deu ruim!")); } return(BadRequest()); }