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()); }
public async Task <HotelRoom> CreateHotelRoom(HotelRoom hotelroom) { _context.HotelRooms.Add(hotelroom); await _context.SaveChangesAsync(); return(hotelroom); }
public async Task <Room> CreateRoom(Room room) { _context.Rooms.Add(room); await _context.SaveChangesAsync(); return(room); }
public async Task <AmenityDTO> CreateAmenities(Amenities amenities) { var amenitydto = ConvertToDTO(amenities); _context.Amenities.Add(amenities); await _context.SaveChangesAsync(); return(amenitydto); }