Exemplo n.º 1
0
        public async Task <ActionResult <SpeakerModel[]> > Get()
        {
            try
            {
                var results = await _repository.GetAllSpeakersAsync();

                return(_mapper.Map <SpeakerModel[]>(results));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }
        }
Exemplo n.º 2
0
        public async Task <ActionResult <SpeakerModel[]> > GetAllSpeakersAsync()
        {
            try
            {
                var ListCapms = await campRepository.GetAllSpeakersAsync();

                SpeakerModel[] campModels = mapper.Map <SpeakerModel[]>(ListCapms);
                return(campModels);
            }
            catch (Exception)
            {
                return(this.StatusCode(500, "Database Failure"));
            }
        }
Exemplo n.º 3
0
        public async Task <IActionResult> GetAllSpeakers()
        {
            try
            {
                var SpeakersList = await _campRepository.GetAllSpeakersAsync();

                if (!SpeakersList.Any())
                {
                    return(NotFound());
                }

                return(Ok(SpeakersList));
            }
            catch
            {
                return(this.StatusCode(500, "Database Shutdown"));
            }
        }