public async Task <IActionResult> PutRoomAmenities(string id, RoomAmenities roomAmenities)
        {
            if (id != roomAmenities.AmenitiesID)
            {
                return(BadRequest());
            }

            _context.Entry(roomAmenities).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RoomAmenitiesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
 public async Task UpdateHotelRoom(int hotelroomID, HotelRoom hotelroom)
 {
     _context.Entry(hotelroom).State = EntityState.Modified;
     await _context.SaveChangesAsync();
 }
 public async Task UpdateRoom(int roomID, Room room)
 {
     _context.Entry(room).State = EntityState.Modified;
     await _context.SaveChangesAsync();
 }