Пример #1
0
        public int AddUserLike(string userName, int postId)
        {
            int  countOfLikes = 0;
            bool getLike      = true;
            Post post         = _postsRepository.GetPostById(postId);
            Like like         = FillLikeOrDislike(userName, postId, getLike, post);

            _likesRepository.AddLike(like, post);
            countOfLikes = _likesRepository.GetLikesOrDislikes(postId, getLike);
            return(countOfLikes);
        }