public bool Postcomment(comment comment) { bookEntities ctx = new bookEntities(); ctx.comment.Add(comment); ctx.SaveChanges(); return(true); }
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); }