예제 #1
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var results = await _repo.GetAllEventoAsync(true);

                return(Ok(results));
            }
            catch (System.Exception)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, "Banco Dados Falhou"));
            }
        }
        public async Task <IActionResult> Get()
        {
            try
            {
                var eventos = await _repo.GetAllEventoAsync(true);

                var results = _mapper.Map <EventoDto[]>(eventos);
                return(Ok(results));
            }
            catch (System.Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Banco de dados falhou {ex.Message}"));
            }
        }