public ActionResult Edit([Bind(Include = "Id,Stars,HotelName,LocationsId")] Hotel hotel) { if (ModelState.IsValid) { db.Entry(hotel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LocationsId = new SelectList(db.Locations, "Id", "Country", hotel.LocationId); return(View(hotel)); }
public void UpdateItem(T item) { _contex.Entry(item).State = EntityState.Modified; }