コード例 #1
0
        public async Task HandleAsync(RejectInvitationCommand message)
        {
            var user = await this.domainRepository.GetByKeyAsync <Guid, User>(message.UserId);

            var invitation = await this.domainRepository.GetByKeyAsync <Guid, Invitation>(message.InvitationId);

            user.RejectInvitation(invitation);
            await this.domainRepository.SaveAsync <Guid, User>(user);
        }
コード例 #2
0
ファイル: SocialController.cs プロジェクト: yonglehou/we-text
        public IHttpActionResult RejectInvitation([FromBody] dynamic model)
        {
            var currentUserId = (string)model.CurrentUserId;
            var invitationId  = (string)model.InvitationId;
            var command       = new RejectInvitationCommand
            {
                InvitationId = Guid.Parse(invitationId),
                UserId       = Guid.Parse(currentUserId)
            };

            this.CommandSender.Publish(command);
            return(Ok());
        }