Exemple #1
0
 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));
 }
Exemple #2
0
 public void UpdateItem(T item)
 {
     _contex.Entry(item).State = EntityState.Modified;
 }