コード例 #1
0
        public ActionResult DeleteComment()
        {
            int deleteCommentId;

            deleteCommentId = int.Parse(Request.Form["currentCommentID"]);
            int     pictureId       = int.Parse(Request.Form["CurrentPictureID"]);
            Comment commentToDelete = db.Comments.Find(deleteCommentId);

            db.Comments.Remove(commentToDelete);
            db.SaveChanges();
            NotificationsController.RemoveCommentNotification(commentToDelete, pictureId);
            return(RedirectToAction("Details/" + pictureId, "Pictures"));
        }