Пример #1
0
        public async Task AddHotel(Hotel newHotel, string travelIdentity)
        {
            var hotel        = HotelConverter.ToDbHotel(newHotel);
            var hotelDetails = await HotelsApiClient.GetHotelDetails(hotel.DestinationId);

            await HotelRepository.AddHotel(hotel, travelIdentity);

            foreach (var location in hotelDetails.Transportation.TransportLocations)
            {
                var transports        = location.Locations.Select(l => HotelConverter.ToDbTransportLocation(l));
                var transportCategory = new DbHotelTransport {
                    Category = location.Category
                };
                await HotelRepository.AddHotelTransport(hotel.HotelId, transportCategory, transports);
            }
        }