Пример #1
0
 public void Dispose()
 {
     if (BookingRepository != null)
     {
         BookingRepository.Dispose();
         BookingRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
     if (RoomClassRepository != null)
     {
         RoomClassRepository.Dispose();
         RoomClassRepository = null;
     }
     if (RoomTypeRepository != null)
     {
         RoomTypeRepository.Dispose();
         RoomTypeRepository = null;
     }
     if (ActivityRepository != null)
     {
         ActivityRepository.Dispose();
         ActivityRepository = null;
     }
     if (AgencyRepository != null)
     {
         AgencyRepository.Dispose();
         AgencyRepository = null;
     }
     if (AgencyContactRepository != null)
     {
         AgencyContactRepository.Dispose();
         AgencyContactRepository = null;
     }
     if (CustomerRepository != null)
     {
         CustomerRepository.Dispose();
         CustomerRepository = null;
     }
     if (GoldenDayRepository != null)
     {
         GoldenDayRepository.Dispose();
         GoldenDayRepository = null;
     }
 }
        public void Dispose()
        {
            if (AgencyRepository != null)
            {
                AgencyRepository.Dispose();
                AgencyRepository = null;
            }

            if (AgencyContactRepository != null)
            {
                AgencyContactRepository.Dispose();
                AgencyContactRepository = null;
            }

            if (SeriesRepository != null)
            {
                SeriesRepository.Dispose();
                SeriesRepository = null;
            }

            if (TripRepository != null)
            {
                TripRepository.Dispose();
                TripRepository = null;
            }

            if (RoomClassRepository != null)
            {
                RoomClassRepository.Dispose();
                RoomClassRepository = null;
            }

            if (RoomTypeRepository != null)
            {
                RoomTypeRepository.Dispose();
                RoomTypeRepository = null;
            }

            if (CruiseRepository != null)
            {
                CruiseRepository.Dispose();
                CruiseRepository = null;
            }

            if (BookingRepository != null)
            {
                BookingRepository.Dispose();
                BookingRepository = null;
            }

            if (BookingRoomRepository != null)
            {
                BookingRoomRepository.Dispose();
                BookingRoomRepository = null;
            }

            if (CustomerRepository != null)
            {
                CustomerRepository.Dispose();
                CustomerRepository = null;
            }
        }