public ActionResult Edit([Bind(Include = "Id,City,Street")] 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,Name,AddressId")] Studio studio) { if (ModelState.IsValid) { db.Entry(studio).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AddressId = new SelectList(db.Addresses, "Id", "City", studio.AddressId); return(View(studio)); }
public ActionResult Edit([Bind(Include = "Id,Content,AuthorId")] Tweet tweet) { if (ModelState.IsValid) { db.Entry(tweet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AuthorId = new SelectList(db.Users, "Id", "Email", tweet.AuthorId); return(View(tweet)); }
public ActionResult Edit([Bind(Include = "Id,Name,Age,StudioId,AddressId")] Person person) { if (ModelState.IsValid) { db.Entry(person).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AddressId = new SelectList(db.Addresses, "Id", "City", person.AddressId); ViewBag.StudioId = new SelectList(db.Studios, "Id", "Name", person.StudioId); return(View(person)); }
public ActionResult Edit([Bind(Include = "Id,Date,Title,DirectorId,LeadingMaleRoleId,LeadingFemaleRoleId")] Movie movie) { if (ModelState.IsValid) { db.Entry(movie).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DirectorId = new SelectList(db.People, "Id", "Name", movie.DirectorId); ViewBag.LeadingFemaleRoleId = new SelectList(db.People, "Id", "Name", movie.LeadingFemaleRoleId); ViewBag.LeadingMaleRoleId = new SelectList(db.People, "Id", "Name", movie.LeadingMaleRoleId); return(View(movie)); }