public async Task <IActionResult> Edit(int id, [Bind("HotelId,Name,Address,Phone")] Hotel hotel) { if (id != hotel.HotelId) { return(NotFound()); } if (ModelState.IsValid) { try { await _hotel.UpdateHotel(hotel); } catch (DbUpdateConcurrencyException) { if (!_hotel.HotelExists(hotel.HotelId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hotel)); }