public override void Import(string path) { Parser = _parserFactory.Create <Country>(Provider.GetFirstLine(path)); LoadData(path); var eanCountries = EanCountries.ToArray(); EanCountries = null; var regionsRepository = FactoryOfRepositories.Regions(); var regionsEanIdsToIds = regionsRepository.EanIdsToIds; regionsEanIdsToIds = ImportRegions(eanCountries, regionsRepository, regionsEanIdsToIds); ImportLocalizedRegions(eanCountries, FactoryOfRepositories.OfLocalized <LocalizedRegion>(), regionsEanIdsToIds); var typeOfRegionCountryId = FactoryOfRepositories.GeographyNamesRepository <TypeOfRegion>().GetId("Country"); ImportRegionsToTypes(eanCountries, FactoryOfRepositories.RegionsToTypes(), regionsEanIdsToIds, typeOfRegionCountryId); ImportRegionsToRegions(eanCountries, FactoryOfRepositories.GeographyManyToMany <RegionToRegion>(), regionsEanIdsToIds); var countriesRepository = FactoryOfRepositories.AdditionalRegionsInfo <Data.Entity.Model.Geography.Country>(); ImportCountries(eanCountries, countriesRepository, regionsEanIdsToIds); ImportProbablyMissingCountries(ProbablyMissingCoutries, countriesRepository, typeOfRegionCountryId, regionsRepository); }
public override void Import(string path) { var languageId = CultureInfo(EanLanguageCode(System.IO.Path.GetFileName(path))).LCID; LoadData(path); ImportLocalizedAccommodations(EanDataTransferObjects, FactoryOfRepositories.OfLocalized <LocalizedAccommodation>(), FactoryOfRepositories.MappedProperties <Accommodation>().EanIdsToIds, languageId, CreatorId); EanDataTransferObjects = null; }
public override void Import(string path) { LoadData(path); var eanIdsToIds = ImportRegions(EanDataTransferObjects, FactoryOfRepositories.Regions(), CreatorId); ImportLocalizedRegions(EanDataTransferObjects, FactoryOfRepositories.OfLocalized <LocalizedRegion>(), eanIdsToIds, DefaultLanguageId, CreatorId); EanDataTransferObjects = null; }
public override void Import(string path) { LoadData(path); var typesOfAccommodationsEanIdsToIds = ImportTypesOfAccommodations(EanIdsToNames.Keys, FactoryOfRepositories.MappedProperties <TypeOfAccommodation>(), CreatorId); ImportLocalizedTypesOfAccommodations(EanIdsToNames, FactoryOfRepositories.OfLocalized <LocalizedTypeOfAccommodation>(), typesOfAccommodationsEanIdsToIds, DefaultLanguageId, CreatorId); EanIdsToNames = null; }
public override void Import(string path) { LoadData(path); var eanIdsToIds = ImportRegions(EanDataTransferObjects, FactoryOfRepositories.Regions(), CreatorId); ImportLocalizedRegions(EanDataTransferObjects, FactoryOfRepositories.OfLocalized <LocalizedRegion>(), eanIdsToIds, DefaultLanguageId, CreatorId); ImportRegionsToTypes(EanDataTransferObjects, FactoryOfRepositories.RegionsToTypes(), eanIdsToIds, FactoryOfRepositories.GeographyNamesRepository <TypeOfRegion>().GetId("Train Station"), FactoryOfRepositories.GeographyNamesRepository <SubClass>().GetId("train"), CreatorId); EanDataTransferObjects = null; }
public override void Import(string path) { LogBuild <Region>(); LoadData(path); var eanIdsToIds = ImportRegions(Regions.ToArray(), FactoryOfRepositories.Regions(), 90000, p => p.CenterCoordinates); Regions = null; ImportLocalizedRegions(AdeptsToLocalizedRegions, FactoryOfRepositories.OfLocalized <LocalizedRegion>(), eanIdsToIds, DefaultLanguageId, CreatorId); var regionsEanIds = AdeptsToLocalizedRegions.Keys; AdeptsToLocalizedRegions = null; ImportRegionsToTypes(regionsEanIds, FactoryOfRepositories.RegionsToTypes(), eanIdsToIds, TypeOfRegionId, SubClassId, CreatorId); }
public override void Import(string path) { LoadData(path); var airportsCoordinates = EanDataTransferObjects.ToArray(); EanDataTransferObjects = null; var regionsEanIdsToIds = ImportRegions(airportsCoordinates, FactoryOfRepositories.Regions(), CreatorId); ImportLocalizedRegions(airportsCoordinates, FactoryOfRepositories.OfLocalized <LocalizedRegion>(), regionsEanIdsToIds, DefaultLanguageId, CreatorId); ImportAirports(airportsCoordinates, FactoryOfRepositories.AdditionalRegionsInfo <Airport>(), regionsEanIdsToIds, CreatorId); ImportRegionsToTypes(airportsCoordinates, FactoryOfRepositories.RegionsToTypes(), regionsEanIdsToIds, FactoryOfRepositories.GeographyNamesRepository <TypeOfRegion>().GetId("Airport"), FactoryOfRepositories.GeographyNamesRepository <SubClass>().GetId("airport")); ImportRegionsToRegions(airportsCoordinates, FactoryOfRepositories.GeographyManyToMany <RegionToRegion>(), regionsEanIdsToIds, FactoryOfRepositories.AdditionalRegionsInfo <Country>().CodesToIds, CreatorId); }
public override void Import(string path) { Parser = _parserFactory.Create <ParentRegion>(Provider.GetFirstLine(path)); LoadData(path); var parentRegions = ParentRegions.ToArray(); const int batchSize = 300000; var eanRegionIdsToIds = ImportRegions(parentRegions, FactoryOfRepositories.Regions(), batchSize, CreatorId, out var subClassNames); var subClasses = ImportSubClasses(FactoryOfRepositories.GeographyNamesRepository <SubClass>(), subClassNames, CreatorId); ImportRegionsToTypes(parentRegions, FactoryOfRepositories.GeographyManyToMany <RegionToType>(), batchSize, eanRegionIdsToIds, FactoryOfRepositories.GeographyNamesRepository <TypeOfRegion>().NamesToIds, subClasses, CreatorId); ImportLocalized(parentRegions, FactoryOfRepositories.OfLocalized <LocalizedRegion>(), batchSize, eanRegionIdsToIds, DefaultLanguageId, CreatorId); ImportRegionsToRegions(parentRegions, FactoryOfRepositories.GeographyManyToMany <RegionToRegion>(), batchSize, eanRegionIdsToIds, CreatorId); ParentRegions = null; }