public async Task <ActionResult <IEnumerable <WorkshopDto> > > GetWorkshops() { var workshops = (await _workshopRepo.GetAllAsync()).ToList(); if (workshops == null || workshops.Count == 0) { return(NotFound(new { error = "no workshops could be found" })); } else { IEnumerable <WorkshopDto> workshopDtos = workshops.Select(w => _mapper.Map <WorkshopDto>(w)); return(Ok(workshopDtos)); } }