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