示例#1
0
        public void AddRoom(Room room)
        {
            if (ReservationRooms.Any(x => x.Room == room))
            {
                throw new HotelException($"Pokój {room} już istnieje w tej rezerwacji.");
            }

            var reservationRoom = new ReservationRoom(this, room);

            ReservationRooms.Add(reservationRoom);
        }
示例#2
0
 public bool IsRoomInReservation(Room room) => ReservationRooms.Any(x => x.Room.Id == room.Id);