Esempio n. 1
0
        public async Task Vote(UserVoteViewModel voteInfo)
        {
            var updateInfo = new UpdatingOperation(voteInfo.SubwebbitId, voteInfo.ThreadId);

            if (!string.IsNullOrWhiteSpace(voteInfo.ParentCommentId))
            {
                updateInfo.AddNestedCommentFilter(ObjectId.Parse(voteInfo.ParentCommentId));
            }

            if (!string.IsNullOrWhiteSpace(voteInfo.CommentId))
            {
                updateInfo.AddNestedCommentFilter(ObjectId.Parse(voteInfo.CommentId));
            }

            await UpdateRating(updateInfo, voteInfo.VoteChange);
            await UpdateUserInVotersLists(updateInfo, voteInfo.VoteChange);
        }