常用方法
常用方法
常用方法
常用方法
public ActionResult Delete(int commentID) { if (User.Identity.IsAuthenticated) { using (var ctx = new MVCLabbDB()) { var commentToRemove = repo.ByID(commentID); if (commentToRemove != null) { repo.Delete(commentID); } return(Content("Comment was removed.")); } } return(Content("Couldn't remove comment.")); }