private void ImportLocalized <T>( IEnumerable <ParentRegion> parentRegions, ILocalizedRepository <T> repository, int batchSize, IReadOnlyDictionary <long, int> eanIdsToIds, int languageId, int creatorId ) where T : LocalizedRegion, new() { LogBuild <T>(); var localizedEntities = BuildLocalizedRegions <T>(parentRegions, eanIdsToIds, languageId, creatorId); var count = localizedEntities.Length; LogBuilded(count); if (count <= 0) { return; } LogSave <T>(); repository.BulkSave(localizedEntities, batchSize); LogSaved <T>(); }
protected void ImportLocalizedAccommodations( IEnumerable <IToLocalizedAccommodation> eanDataTransferObjects, ILocalizedRepository <LocalizedAccommodation> repository, IReadOnlyDictionary <int, int> accommodationsEanIdsToIds, int languageId, int creatorId ) { LogBuild <LocalizedAccommodation>(); var localizedAccommodations = BuildLocalizedAccommodations(eanDataTransferObjects, accommodationsEanIdsToIds, languageId, creatorId); var count = localizedAccommodations.Length; LogBuilded(count); if (count <= 0) { return; } LogSave <LocalizedAccommodation>(); repository.BulkSave(localizedAccommodations); LogSaved <LocalizedAccommodation>(); }
private void ImportLocalizedRegions(Country[] eanCountries, ILocalizedRepository <LocalizedRegion> repository, IReadOnlyDictionary <long, int> regionsEanIdsToIds) { Logger.Log("Build localizedRegions from CountryList"); var localizedRegions = BuildLocalizedRegions(eanCountries, regionsEanIdsToIds, DefaultLanguageId, CreatorId); var count = localizedRegions.Length; LogBuilded(count); if (count <= 0) { return; } LogSave <LocalizedRegion>(); repository.BulkSave(localizedRegions, count); LogSaved <LocalizedRegion>(); }
private void ImportLocalizedTypesOfAccommodations(IDictionary <int, string> expediaIdsToNames, ILocalizedRepository <LocalizedRealEstateType> repository, IReadOnlyDictionary <int, int> typesOfAccommodationsExpediaIdsToIds, int languageId, int creatorId) { LogBuild <LocalizedRealEstateType>(); var localizedTypesOfAccommodations = BuildLocalizedTypesOfAccommodations(expediaIdsToNames, typesOfAccommodationsExpediaIdsToIds, languageId, creatorId); var count = localizedTypesOfAccommodations.Length; if (count <= 0) { return; } LogSave <LocalizedRealEstateType>(); repository.BulkSave(localizedTypesOfAccommodations, count); LogSaved <LocalizedRealEstateType>(); }
protected void ImportLocalizedRegions( IEnumerable <IHaveRegionIdRegionName> eanDataTransferObjects, ILocalizedRepository <LocalizedRegion> repository, IReadOnlyDictionary <long, int> ExpediaIdsToIds, int languageId, int creatorId ) { LogBuild <LocalizedRegion>(); var localizedRegions = BuildLocalizedRegions(eanDataTransferObjects, ExpediaIdsToIds, languageId, creatorId); var count = localizedRegions.Length; LogAssembled(count); if (count <= 0) { return; } LogSave <LocalizedRegion>(); repository.BulkSave(localizedRegions, count); LogSaved <LocalizedRegion>(); }
private void ImportLocalizedRegions( IEnumerable <AirportCoordinates> airportsCoordinates, ILocalizedRepository <LocalizedRegion> repository, IReadOnlyDictionary <long, int> eanIdsToIds, int languageId, int creatorId ) { LogBuild <LocalizedRegion>(); var localizedRegions = BuildLocalizedRegions(airportsCoordinates, eanIdsToIds, languageId, creatorId); var count = localizedRegions.Length; LogBuilded(count); if (count <= 0) { return; } LogSave <LocalizedRegion>(); repository.BulkSave(localizedRegions, count); LogSaved <LocalizedRegion>(); }