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));
        }
예제 #2
0
 public Workshops GetWorkshopById(int id)
 {
     return(workshopRepository.GetWorkshopById(id));
 }