Пример #1
0
        public async Task AddLocation(DomainLocation newLocation, string travelIdentity)
        {
            var location = LocationConverter.ToDbLocation(newLocation);
            var tours    = await TriposoApiClient.GetTourInformation(location.Name);

            var toursDb = tours.Select(t => TourConverter.ToDbTour(t));

            foreach (var t in toursDb)
            {
                await TourRepository.AddTour(t, travelIdentity);
            }
            await LocationRepository.AddLocation(location, travelIdentity);
        }