Exemplo n.º 1
0
        public int ReactToComm(int userId, long commId, int reactId)
        {
            RemoveReactionFromComm(commId, userId);

            return(ExecuteInTransaction(unit =>
            {
                var ucr = new UserCommentReacts()
                {
                    CommentId = commId,
                    UserId = userId,
                    ReactId = reactId
                };

                unit.UsersCommentsReacts.Insert(ucr);
                return unit.Complete();
            }));
        }
Exemplo n.º 2
0
        public int ChangeReact(int newReactId, int userId, long commId)
        {
            var newreact = new UserCommentReacts()
            {
                ReactId   = newReactId,
                UserId    = userId,
                CommentId = commId
            };

            var oldReact = GetUserCommReact(userId, commId);

            return(ExecuteInTransaction(unit =>
            {
                unit.UsersCommentsReacts.Delete(oldReact);
                unit.UsersCommentsReacts.Insert(newreact);

                return unit.Complete();
            }));
        }