public async Task <ActionResult <WorkshopDto> > GetWorkshop([FromRoute] int workshopId) { Workshop workshop = await _workshopRepo.GetWorkshopById(workshopId); if (workshop == null) { return(NotFound(new { error = $"workshop with id {workshopId} could not be found" })); } WorkshopDto workshopDto = _mapper.Map <WorkshopDto>(workshop); return(Ok(workshopDto)); }
public Workshops GetWorkshopById(int id) { return(workshopRepository.GetWorkshopById(id)); }