public ActionResult Create(Location location) { if (ModelState.IsValid) { db.Locations.Add(location); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.ValidationStateID = new SelectList(db.ValidationStates, "ValidationStateID", "Description", location.ValidationStateID); return View(location); }
public ActionResult Edit(Location location) { if (ModelState.IsValid) { db.Entry(location).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.ValidationStateID = new SelectList(db.ValidationStates, "ValidationStateID", "Description", location.ValidationStateID); return View(location); }