예제 #1
0
        public async Task <IActionResult> Get(int id)
        {
            try
            {
                var evento = await _eventoService.GetAEventoByIdAsync(id, true);

                if (evento == null)
                {
                    return(NotFound("evento por id encontrado."));
                }
                return(Ok(evento));
            }
            catch (Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError,
                                       $"Erro ao tentar recuperar eventos. Erro: {ex.Message}"));
            }
        }