/// <summary> /// Delete a post vote /// </summary> /// <param name="postVote">Post vote</param> public virtual void DeletePostVote(ForumPostVote postVote) { if (postVote == null) throw new ArgumentNullException("postVote"); _forumPostVoteRepository.Delete(postVote); // update post var post = this.GetPostById(postVote.ForumPostId); post.VoteCount = postVote.IsUp ? --post.VoteCount : ++post.VoteCount; this.UpdatePost(post); //event notification _eventPublisher.EntityDeleted(postVote); }
/// <summary> /// Update a post vote /// </summary> /// <param name="postVote">Post vote</param> public virtual void UpdatePostVote(ForumPostVote postVote) { if (postVote == null) throw new ArgumentNullException("postVote"); _forumPostVoteRepository.Update(postVote); //event notification _eventPublisher.EntityUpdated(postVote); }