예제 #1
0
        private void ImportRegionsToTypes(
            IEnumerable <TrainMetroStationCoordinates> trainsMetroStationCoordinateses,
            IRegionsToTypesRepository repository,
            IReadOnlyDictionary <long, int> eanIdsToIds,
            int typeOfRegionTrainStationId,
            int subClassTrainId,
            int creatorId
            )
        {
            LogBuild <RegionToType>();

            var regionsToTypes = BuildRegionsToTypes(trainsMetroStationCoordinateses, eanIdsToIds,
                                                     typeOfRegionTrainStationId, subClassTrainId, creatorId);

            var count = regionsToTypes.Length;

            LogBuilded(count);

            if (count <= 0)
            {
                return;
            }

            LogSave <RegionToType>();
            repository.BulkSave(regionsToTypes);
            LogSaved <RegionToType>();
        }
예제 #2
0
        private void ImportRegionsToTypes(
            Country[] eanCountries,
            IRegionsToTypesRepository repository,
            IReadOnlyDictionary <long, int> regionsEanIdsToIds,
            int typeOfRegionCountryId
            )
        {
            if (eanCountries == null)
            {
                throw new ArgumentNullException(nameof(eanCountries));
            }
            LogBuild <RegionToType>();
            var regionsToTypes = BuildRegionsToTypes(eanCountries, regionsEanIdsToIds, typeOfRegionCountryId, CreatorId);
            var count          = regionsToTypes.Length;

            LogAssembled(count);

            if (count <= 0)
            {
                return;
            }
            LogSave <RegionToType>();
            repository.BulkSave(regionsToTypes);
            LogSaved <RegionToType>();
        }
예제 #3
0
        private void ImportRegionsToTypes(
            Country[] eanCountries,
            IRegionsToTypesRepository repository,
            IReadOnlyDictionary <long, int> regionsEanIdsToIds,
            int typeOfRegionCountryId
            )
        {
            LogBuild <RegionToType>();
            var regionsToTypes = BuildRegionsToTypes(eanCountries, regionsEanIdsToIds, typeOfRegionCountryId, CreatorId);
            var count          = regionsToTypes.Length;

            LogBuilded(count);

            if (count <= 0)
            {
                return;
            }
            LogSave <RegionToType>();
            repository.BulkSave(regionsToTypes);
            LogSaved <RegionToType>();
        }
예제 #4
0
        private void ImportRegionsToTypes(
            IEnumerable <AirportCoordinates> airportsCoordinates,
            IRegionsToTypesRepository repository,
            IReadOnlyDictionary <long, int> eanIdsToIds,
            int typeOfRegionAirportId, int subClassAirportId)
        {
            LogBuild <RegionToType>();
            var regionsToTypes =
                BuildRegionsToTypes(airportsCoordinates, eanIdsToIds, typeOfRegionAirportId, subClassAirportId, CreatorId);
            var count = regionsToTypes.Length;

            LogBuilded(count);

            if (count <= 0)
            {
                return;
            }

            LogSave <RegionToType>();
            repository.BulkSave(regionsToTypes);
            LogSaved <RegionToType>();
        }
예제 #5
0
        private void ImportRegionsToTypes(
            ICollection <long> regionsEanIds,
            IRegionsToTypesRepository repository,
            IReadOnlyDictionary <long, int> eanIdsToIds,
            int typeOfRegionId,
            int subClassId,
            int creatorId
            )
        {
            LogBuild <RegionToType>();
            var regionsToTypes = BuildRegionsToTypes(regionsEanIds, eanIdsToIds, typeOfRegionId, subClassId, creatorId);
            var count          = regionsToTypes.Length;

            LogAssembled(count);

            if (count <= 0)
            {
                return;
            }

            LogSave <RegionToType>();
            repository.BulkSave(regionsToTypes, count, rtt => rtt.SubClassId);
            LogSaved <RegionToType>();
        }