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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }