public int Add(int userId, int conferenceId, InfoPageDto infoPageDto)
        {
            if (CheckUserUpdatePermission(userId, conferenceId))
            {
                var infoPage = _mapper.Map <InfoPage>(infoPageDto);
                infoPage.ConferenceId = conferenceId;

                return(_infoPageRepository.Add(infoPage));
            }

            throw new NotEnoughRightsException();
        }
Exemple #2
0
        public IActionResult Add(int id, [FromBody] InfoPageDto infoPage)
        {
            var userId = Convert.ToInt32(User.FindFirst(ClaimTypes.NameIdentifier).Value);

            return(Ok(_infoPageService.Add(userId, id, infoPage)));
        }