コード例 #1
0
        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.Localized <LocalizedRegion>(), regionsEanIdsToIds);

            var typeOfRegionCountryId = FactoryOfRepositories.BaseNames <TypeOfRegion>().GetId("Country");

            ImportRegionsToTypes(eanCountries, FactoryOfRepositories.RegionsToTypes(), regionsEanIdsToIds, typeOfRegionCountryId);

            ImportRegionsToRegions(eanCountries, FactoryOfRepositories.ManyToMany <RegionToRegion>(), regionsEanIdsToIds);

            var countriesRepository = FactoryOfRepositories.AdditionalRegionsInfo <Data.Entity.Country>();

            ImportCountries(eanCountries, countriesRepository, regionsEanIdsToIds);

            ImportProbablyMissingCoutries(ProbablyMissingCoutries, countriesRepository, typeOfRegionCountryId, regionsRepository);
        }
コード例 #2
0
        public override void Import(string path)
        {
            Parser = _parserFactory.Create <Country>(Provider.GetFirstLine(path));

            LoadData(path);

            var expediaCountries = EanCountries.ToArray();

            EanCountries = null;

            var regionsRepository      = RepositoryFactory.Regions();
            var regionsExpediaIdsToIds = regionsRepository.ExpediaIdsToIds;

            var subtypeCountryId = RepositoryFactory.Names <Subtype>().GetId("Country");

            regionsExpediaIdsToIds = ImportRegions(expediaCountries, regionsRepository, regionsExpediaIdsToIds, subtypeCountryId);

            ImportLocalizedRegions(expediaCountries, RepositoryFactory.Localized <LocalizedRegion>(), regionsExpediaIdsToIds);

            //ImportRegionsToTypes(eanCountries, RepositoryFactory.ManyToMany<RegionToSubclass>(), regionsExpediaIdsToIds, subtypeCountryId);

            ImportRegionsToRegions(expediaCountries, RepositoryFactory.ManyToMany <RegionToRegion>(), regionsExpediaIdsToIds);

            var countriesRepository = RepositoryFactory.AdditionalRegionsInfo <Data.Geography.Country>();

            ImportCountries(expediaCountries, countriesRepository, regionsExpediaIdsToIds);

            ImportProbablyMissingCountries(ProbablyMissingCountries, countriesRepository, subtypeCountryId, regionsRepository);
        }
コード例 #3
0
ファイル: RegionsImporter.cs プロジェクト: Olbrasoft/Travel
        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;
        }
コード例 #4
0
 protected override void LoadData(string path)
 {
     Parser = _parserFactory.Create <T>(Provider.GetFirstLine(path));
     base.LoadData(path);
 }
コード例 #5
0
ファイル: XmlLoader.cs プロジェクト: nagyistge/OmniXAML
        public object Load(Stream stream, Settings loadSettings)
        {
            var parser = parserFactory.Create(loadSettings);

            return(Load(stream, parser));
        }