Пример #1
0
        //发表评论 实验代码  可删除
        public void BbookComments(int UserID, int BookID, string Comment_Content, DateTime dateTime)
        {
            var bookComment = new BookComment()
            {
                UserID          = UserID,
                BookID          = BookID,
                Comment_Content = Comment_Content,
                Comment_Time    = dateTime
            };

            db.BookComment.Add(bookComment);
            db.SaveChanges();
        }
Пример #2
0
 //发表评论 正式代码
 public void AddComment(BookComment comment)
 {
     db.BookComment.Add(comment);
     db.SaveChanges();
 }