예제 #1
0
        public ActionResult Create(GuestBook guestbook)
        {
            if (ModelState.IsValid)
            {
                db.GuestBooks.Add(guestbook);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(guestbook);
        }
예제 #2
0
 public ActionResult Edit(GuestBook guestbook)
 {
     if (ModelState.IsValid)
     {
         db.Entry(guestbook).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(guestbook);
 }