Esempio n. 1
0
        public void AddComment(int id, CommentInputModel comment)
        {
            //adds data into new comment
            var newComment = new Comment {
                BookId   = id,
                Comments = comment.Comment,
                Rating   = comment.Rating
            };

            _bookRepo.AddComment(newComment);
        }
Esempio n. 2
0
        public void AddComment(CommentInputModel inputComment, string currentUser)
        {
            var commentToAdd = new Comment
            {
                UserId      = currentUser,
                BookId      = inputComment.BookId,
                CommentText = inputComment.CommentText
            };

            _bookRepo.AddComment(commentToAdd);
        }