Beispiel #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Email,PhoneNumber,PhoneType")] Person person)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(person));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,ModelName,Make,Year,PersonId")] Car car)
 {
     if (ModelState.IsValid)
     {
         db.Entry(car).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PersonId = new SelectList(db.People, "Id", "Name", car.PersonId);
     return(View(car));
 }