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