public ActionResult Edit([Bind(Include = "Id,Name")] Location location)
 {
     if (ModelState.IsValid)
     {
         db.Entry(location).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(location));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,StNumber,StName,City,State")] Address address)
 {
     if (ModelState.IsValid)
     {
         db.Entry(address).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(address));
 }
 public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,LocationId")] Person person)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LocationId = new SelectList(db.Locations, "Id", "Name", person.LocationId);
     return(View(person));
 }