Beispiel #1
0
        public async Task <IActionResult> Post([FromBody] EventParticipantsInputModel eventParticipants)
        {
            bool ret;
            var  personId = GetPersonId();

            if (!personId.HasValue)
            {
                return(NotFound());
            }

            eventParticipants.PersonId = (int)personId;

            ret = await _eventService.AddEventParticipants(eventParticipants);

            return(Ok(new { Ok = ret }));
        }
 public async Task <bool> AddEventParticipants(EventParticipantsInputModel eventParticipantsInputModel)
 {
     return(await _eventParticipantsRepository.Add(new EventParticipants(eventParticipantsInputModel.PersonId, eventParticipantsInputModel.EventId, false)) > 0);
 }