public ActionResult Edit([Bind(Include = "Id,Name,Price,Description,Rating,Category")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,OrderedOn,FullAddress,AditionalInfo")] Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(order));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "Id,DatePosted,Title,Content,Rating")] BlogPost blogPost)
 {
     if (ModelState.IsValid)
     {
         db.Entry(blogPost).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(blogPost));
 }