Ejemplo n.º 1
0
 public ActionResult Edit(Author author)
 {
     if (ModelState.IsValid)
     {
         db.Entry(author).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(author));
 }
Ejemplo n.º 2
0
 public ActionResult Edit(Art art)
 {
     if (ModelState.IsValid)
     {
         db.Entry(art).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AuthorID = new SelectList(db.Authors, "AuthorID", "FirstName", art.AuthorID);
     return(View(art));
 }
Ejemplo n.º 3
0
 public T Update(T item)
 {
     _context.Entry(item).State = System.Data.Entity.EntityState.Modified;
     return(item);
 }