Example #1
0
        public bool LikePost(User user, string postId)
        {
            try
            {
                _likesRepository.LikePost(user.UserId, postId);
            }
            catch (Exception e)
            {
                _log.Error(e);
                return(false);
            }

            string reciverId = _usersRepository.GetPosting(postId).UserId;

            if (user.UserId != reciverId)
            {
                object obj = new { postId, user, ReciverId = reciverId };
                _serverComunication.NotifyUser("/UserLikePost", obj);
            }

            return(true);
        }