public ActionResult Edit(Building building) { if (ModelState.IsValid) { db.Entry(building).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(building); }
public ActionResult Create(Building building) { if (ModelState.IsValid) { db.Buildings.Add(building); db.SaveChanges(); return RedirectToAction("Index"); } return View(building); }