public async Task <IActionResult> GetBands() { var bandsFromRepo = await _tourManagementRepository.GetBands(); var bands = Mapper.Map <IEnumerable <Band> >(bandsFromRepo); return(Ok(bands)); }
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()); }