public async Task <ActionResult <IEnumerable <AttendeeViewModel> > > GetAttendeesForItemId(string itemId, [FromQuery] AttendeeResourceParameters parameters) { if (!await _itemRepository.ExistItemByIdAsync(itemId)) { return(NotFound()); } var skipNumber = parameters.PageSize * (parameters.PageNumber - 1); var takeNumber = parameters.PageSize; var entities = await _attendeeRepository.GetAttendeesForItemIdAsync(itemId, skipNumber, takeNumber); var models = _mapper.Map <IEnumerable <AttendeeViewModel> >(entities); return(Ok(models)); }