public async Task <IActionResult> GetByTema(string tema) { try { var eventos = await _eventosService.GetAllEventosByTemaAsync(tema, true); if (eventos == null) { return(NotFound("Nenhum evento por tema encontrado")); } return(Ok(eventos)); } catch (Exception ex) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Erro ao tentar recuperar eventos por tema: Erro {ex.Message}")); } }
public async Task <IActionResult> GetByTema(string tema) { try { var eventos = await _eventoService.GetAllEventosByTemaAsync(tema, true); if (eventos == null) { return(NotFound("Nenhum evento encontrado com o tema especificado.")); } else { return(Ok(eventos)); } } catch (Exception ex) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Erro ao tentar recuperar eventos. Erro: " + ex.Message)); } }