Пример #1
0
 public ActionResult Edit(BooksDB bookdb)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bookdb).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(bookdb);
 }
Пример #2
0
        public ActionResult Create(BooksDB bookdb)
        {
            if (ModelState.IsValid)
            {
                db.Books.Add(bookdb);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(bookdb);
        }