public ActionResult DeleteConfirmed(int id) { PostsHistory postsHistory = db.PostsHistories.Find(id); db.PostsHistories.Remove(postsHistory); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "HistoryId,PostID,Message,ChangedDate,UserId")] PostsHistory postsHistory) { if (ModelState.IsValid) { db.Entry(postsHistory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(postsHistory)); }
public ActionResult Create([Bind(Include = "HistoryId,PostID,Message,ChangedDate,UserId")] PostsHistory postsHistory) { if (ModelState.IsValid) { db.PostsHistories.Add(postsHistory); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(postsHistory)); }
// GET: PostsHistories/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PostsHistory postsHistory = db.PostsHistories.Find(id); if (postsHistory == null) { return(HttpNotFound()); } return(View(postsHistory)); }