public async Task <IActionResult> Edit(int id, [Bind("Id,HotelLink,ListHotel")] HotelListDescription hotelListDescription) { if (id != hotelListDescription.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hotelListDescription); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HotelListDescriptionExists(hotelListDescription.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hotelListDescription)); }
public async Task <IActionResult> Create([Bind("Id,HotelLink,ListHotel")] HotelListDescription hotelListDescription) { if (ModelState.IsValid) { _context.Add(hotelListDescription); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(hotelListDescription)); }