Esempio n. 1
0
        public List <Facility> GetAllFacilities()
        {
            List <Facility> facilities = new List <Facility>();
            Facility        facility   = new Facility();

            using (var dataAccess = new DataAccess.Repositories.DwellingFacilityRepository(appSettings.ConnectionString))
            {
                var _facilities = facility.ConvertDwellingToFacility(dataAccess.GetDwellingFacilities());
                facilities.AddRange(_facilities);
            }

            using (var dataAccess = new DataAccess.Repositories.LandFacilityRepository(appSettings.ConnectionString))
            {
                var _facilities = facility.ConvertLandToFacility(dataAccess.GetLandFacilities());
                facilities.AddRange(_facilities);
            }

            using (var dataAccess = new DataAccess.Repositories.NonResidentialFacilityRepository(appSettings.ConnectionString))
            {
                var _facilities = facility.ConvertNonResidentialToFacility(dataAccess.GetNonResidentialFacilities());
                facilities.AddRange(_facilities);
            }
            return(facilities);
        }