public ActionResult Create(Person person) { if (ModelState.IsValid) { db.People.Add(person); db.SaveChanges(); return RedirectToAction("Detail/"+ person.EntryId,"Book"); } return View(person); }
// // GET: /Person/Create public ActionResult Create(int bookid) { Person p = new Person(); p.EntryId = bookid; return View(p); }
public ActionResult Edit(Person person) { if (ModelState.IsValid) { db.Entry(person).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(person); }