public Post Add(Post param) { _publishToTopic.PublishCP(new IncreasingCP() { UserId = param.AuthorId, Point = 5 }); return(_postRepository.Add(param)); }
private async Task IncreaseCPFor100LikesAsync(string postId) { var post = _postRepository.GetById(postId); int x = post.LikeCount % 100; if (x + 1 == 100) { _publishToTopic.PublishCP(new IncreasingCP() { UserId = post.AuthorId, Point = 1 }); } }