コード例 #1
0
 public ActionResult Edit([Bind(Include = "Id,Sum,DateCreated,IsPaid")] ShoppingCart shoppingCart)
 {
     if (ModelState.IsValid)
     {
         db.Entry(shoppingCart).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(shoppingCart));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Author,Description,Year,Price")] Book book)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(book));
 }