public ActionResult Edit([Bind(Include = "ID,Name,Email")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "ID,Manufacturer,Model,EnginePower")] Car car) { if (ModelState.IsValid) { db.Entry(car).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(car)); }
public ActionResult Edit([Bind(Include = "ID,CarID,CustomerID,SalePrice,PurchasedOn")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CarID = new SelectList(db.Cars, "ID", "Manufacturer", order.CarID); ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", order.CustomerID); return(View(order)); }