public ActionResult Create(GuestBook guestbook) { if (ModelState.IsValid) { db.GuestBooks.Add(guestbook); db.SaveChanges(); return RedirectToAction("Index"); } return View(guestbook); }
public ActionResult Edit(GuestBook guestbook) { if (ModelState.IsValid) { db.Entry(guestbook).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(guestbook); }