Beispiel #1
0
 private void EnforceInvariants(HotelRoomSummary rooms)
 {
     if (rooms.NumberOfSingleRooms < 1 &&
         rooms.NumberOfDoubleRooms < 1 &&
         rooms.NumberOfFamilyRooms < 1)
     {
         throw new Exception("Hotels Must Have Rooms");
     }
 }
Beispiel #2
0
 public Hotel(Guid id, HotelRoomSummary rooms)
 {
     EnforceInvariants(rooms);
     this.Id    = id;
     this.Rooms = rooms;
 }