コード例 #1
0
        public bool Postcomment(comment comment)
        {
            bookEntities ctx = new bookEntities();

            ctx.comment.Add(comment);
            ctx.SaveChanges();

            return(true);
        }
コード例 #2
0
        public bool Deletecomment(comment comment)
        {
            bookEntities ctx = new bookEntities();
            comment      c   = ctx.comment.Find(comment.commentid);

            if (c == null)
            {
                return(false);
            }

            ctx.comment.Remove(c);
            ctx.SaveChanges();

            return(true);
        }