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); }
public void AddComment(CommentInputModel inputComment, string currentUser) { var commentToAdd = new Comment { UserId = currentUser, BookId = inputComment.BookId, CommentText = inputComment.CommentText }; _bookRepo.AddComment(commentToAdd); }