コード例 #1
0
        public void RequireDifferentUsersForChatCreation(string username)
        {
            var user = _userValidationService.RequireAndGetUserByUsername(username);

            if (user.Id == _authorizedUser.Id)
            {
                throw new LogicApiException("You can not create a Chat with yourself");
            }
        }
コード例 #2
0
        public void RequireUserIsChannelMember(string username, Guid channelId)
        {
            var user = _userValidationService.RequireAndGetUserByUsername(username);

            RequireUserByIdIsChannelMember(
                user.Id,
                channelId,
                "User is not a member of this channel."
                );
        }
コード例 #3
0
        public void RequireUsernameIsGroupMember(string username, Guid groupId)
        {
            var user = _userValidationService.RequireAndGetUserByUsername(username);

            RequireUserIdIsGroupMember(
                user.Id,
                groupId,
                "User is not a member of this group."
                );
        }