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>(); }
/// <summary> /// Constructor /// </summary> /// <param name="repository"></param> /// <param name="textKeyFactory"></param> /// <param name="logger"></param> /// <param name="nativeCulture">Culture of native strings.</param> /// <param name="defaultCulture">Default culture to use if localized string is missing in current culture. If <c>null</c>, <paramref name="nativeCulture"/> is used.</param> /// <param name="missingLocalizedStringExtensionPoint">Extension point to treat missing localized string in target culture. If <c>null</c>, an instance of <see cref="DefaultMissingLocalizedStringExtensionPoint"/> is used.</param> public DefaultLocalizedStringProvider(ILocalizedRepository repository, ITextKeyFactory textKeyFactory, ILogger logger, CultureInfo nativeCulture, CultureInfo defaultCulture, IMissingLocalizedStringExtensionPoint missingLocalizedStringExtensionPoint) { _repository = repository; _textKeyFactory = textKeyFactory; _logger = logger; _nativeCulture = nativeCulture; _defaultCulture = defaultCulture ?? _nativeCulture; _missingLocalizedStringExtensionPoint = missingLocalizedStringExtensionPoint ?? DefaultMissingLocalizedStringExtensionPoint.Instance; }
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>(); }
public DefaultLocalizedStringProvider(ILocalizedRepository repository, ITextKeyFactory textKeyFactory, ILogger logger, CultureInfo nativeCulture) : this(repository, textKeyFactory, logger, nativeCulture, null, null) { }