Beispiel #1
0
        public async Task <IHttpActionResult> Join(EventJoinViewModel joinOptions)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var optionsDto = _mapper.Map <EventJoinViewModel, EventJoinDto>(joinOptions);

            SetOrganizationAndUser(optionsDto);
            optionsDto.ParticipantIds = new List <string> {
                optionsDto.UserId
            };

            try
            {
                await _eventParticipationService.JoinAsync(optionsDto);

                return(Ok());
            }
            catch (EventException e)
            {
                return(BadRequest(e.Message));
            }
        }
        public EventJoinPage(List <SharingSpace> sharingSpaces)
        {
            this.sharingSpaces = sharingSpaces ?? throw new ArgumentNullException();

            InitializeComponent();
            // BindingContext = new EventListViewModel(sharingSpaces);
            BindingContext = new EventJoinViewModel(sharingSpaces);
            //MessagingCenter.Subscribe<EventJoinViewModel, SharingSpace>(this, "SelectJoinEvent", OnSelectedSharingSpace);
        }