コード例 #1
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var eventos = await _eventoService.GetAllEventoAsync(true);

                if (eventos == null)
                {
                    return(NotFound("Nenhum evento encontrado."));
                }
                return(Ok(eventos));
            }
            catch (Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError,
                                       $"Erro ao tentar recuperar eventos. Erro: {ex.Message}"));
            }
        }
コード例 #2
0
 public async Task <IEnumerable <Evento> > GetAllEventoAsync(bool includePalestrantes = false)
 {
     return(await _eventoService.GetAllEventoAsync(includePalestrantes));
 }