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

            return(View(editora));
        }