public async Task <T> LoadFullCart <T>(CartPersistenceModel cart, CancellationToken cancellationToken) where T : CartModel, new() { T cartModel = new T() { CarReservationDuration = cart.CarReservationDuration, HotelReservationDuration = cart.HotelReservationDuration }; if (cart.DepartingFlight != 0) { cartModel.DepartingFlight = await _flightDataProvider.FindFlight(cart.DepartingFlight, cancellationToken); } if (cart.ReturningFlight != 0) { cartModel.ReturningFlight = await _flightDataProvider.FindFlight(cart.ReturningFlight, cancellationToken); } if (cart.HotelReservation != 0) { cartModel.HotelReservation = await _hotelDataProvider.FindHotel(cart.HotelReservation, cancellationToken); } if (cart.CarReservation != 0) { cartModel.CarReservation = await _carDataProvider.FindCar(cart.CarReservation, cancellationToken); } return(cartModel); }
public async Task <CarModel> FindCar(int carId, CancellationToken cancellationToken) { return(await _carDataProvider.FindCar(carId, cancellationToken)); }