public ActionResult Create(Prop prop) { //Check if model is valid, then add Prop to table and save changes to Database if (ModelState.IsValid) { db.Props.Add(prop); db.SaveChanges(); return RedirectToAction("Index"); } return View(prop); }
public ActionResult Edit(Prop prop) { //Check if model is valid, then edit Prop to table and save changes to Database if (ModelState.IsValid) { db.Entry(prop).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(prop); }