public IActionResult CreateAttendee(int groupId, int subgroupId, [FromBody] AttendeeForCreationDto attendeeForCreationDto)
        {
            if (attendeeForCreationDto == null || attendeeForCreationDto.SubgroupId != subgroupId)
            {
                return(BadRequest());
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var userIdentifier = _registrationAuthorizationService.GetCurrentUserIdentifier(User);

            if (userIdentifier == null)
            {
                return(BadRequest());
            }

            if (!_registrationAuthorizationService.IsAuthorized(userIdentifier, subgroupId))
            {
                return(Unauthorized());
            }

            if (!(_registrationRepository.GroupExists(groupId) && _registrationRepository.SubgroupExists(groupId, subgroupId)))
            {
                return(NotFound());
            }

            var attendeeEntity = Mapper.Map <Entities.Attendee>(attendeeForCreationDto);

            var shirtSize = _registrationRepository.GetShirtSizes().FirstOrDefault(ss => ss.Size == attendeeForCreationDto.ShirtSize);

            attendeeEntity.ShirtSize = shirtSize;

            var attendance = _registrationRepository.GetAttendance(attendeeForCreationDto.Attendance);

            attendeeEntity.Attendance = attendance;

            var user = _registrationRepository.GetUser(userIdentifier);

            attendeeEntity.InsertedById = user.Id;
            attendeeEntity.InsertedOn   = DateTime.UtcNow;

            _registrationRepository.AddAttendee(attendeeEntity);

            if (!_registrationRepository.Save())
            {
                return(StatusCode(500, "A problem happened while handling your request."));
            }

            // Load all Accomodations and Merit Badges
            attendeeEntity = _registrationRepository.GetAttendee(attendeeEntity.SubgroupId, attendeeEntity.Id);

            var createdAttendeeToReturn = Mapper.Map <AttendeeDto>(attendeeEntity);

            return(CreatedAtRoute("GetAttendee", new
                                  { groupId = groupId, subgroupId = subgroupId, attendeeId = createdAttendeeToReturn.Id }, createdAttendeeToReturn));
        }