public async Task <IActionResult> GetBands()
        {
            var bandsFromRepo = await _tourManagementRepository.GetBands();

            var bands = Mapper.Map <IEnumerable <Band> >(bandsFromRepo);

            return(Ok(bands));
        }
예제 #2
0
        public async Task <IActionResult> Get()
        {
            try{
                var bandsFromRepo = await _tourManagementRepository.GetBands();

                var bands = Mapper.Map <IEnumerable <Band> >(bandsFromRepo);
                return(Ok(bands));
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            // Should be a failure response;
            return(BadRequest());
        }