Пример #1
0
        public ActionResult Create(PublishingHouse publishinghouse)
        {
            if (ModelState.IsValid)
            {
                db.PublishingHouses.Add(publishinghouse);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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