/// <inheritdoc/> public IEnumerable <GetWorkshopAttendeesQuery.Attendee> GetWorkshopAttendees(GetWorkshopAttendeesQuery query) { var workshop = _workshopRepository.GetWorkshop(query.Id); if (workshop == null) { throw new NotFoundException(); } else if (workshop.CreatedBy != _userInfo.UserId && !_userInfo.IsAdmin) { throw new ResourceIsForbiddenException(); } return(_attendanceRepository.GetWorkshopAttendees(query.Id) .Select(a => a.Adapt <GetWorkshopAttendeesQuery.Attendee>())); }
/// <inheritdoc/> public GetWorkshopQuery.Workshop GetWorkshop(GetWorkshopQuery query) { Workshop workshop = _repository.GetWorkshop(query.Id); return(workshop == null ? null : workshop.Adapt <GetWorkshopQuery.Workshop>()); }
public Workshop GetWorkshopById(int id) { return(repo.GetWorkshop(id)); }