public void Delete(Location location, AccomodationRepository hotelRepository) { int locationCount = 0; foreach (Hotel hotel in hotelRepository.AccomodationList) { if (hotel.Location.FullName == location.FullName) { locationCount++; } } if (locationCount == 1) { _locationList.Remove(location); } }
public MainRepository() { _accomodationRepository = new AccomodationRepository(); _locationRepository = new LocationRepository(); _reservationRepository = new ReservationRepository(); }