public ActionResult Edit(Place place) { if (ModelState.IsValid) { db.Entry(place).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.ZoneId = new SelectList(db.Zones, "Id", "Name", place.ZoneId); return View(place); }
public ActionResult Create(Place place) { if (ModelState.IsValid) { db.Places.Add(place); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.ZoneId = new SelectList(db.Zones, "Id", "Name", place.ZoneId); return View(place); }