private static CrossSellOfferViewModel OfferToCrossSellOfferViewModel(Offer offer)
 {
     var offerViewModel = new CrossSellOfferViewModel();
     offerViewModel.InjectFrom(offer);
     if (offer.ProductOffers.ProductOffer != null && offer.ProductOffers.ProductOffer.Length > 0)
     {
         offerViewModel.ProductOffersOfferViewModels = offer.ProductOffers.ProductOffer.Select(po =>
         {
             var povm = new ProductOfferViewModel();
             povm.InjectFrom(po);
             return povm;
         }).ToArray();
     }
     return offerViewModel;
 }
Esempio n. 2
0
 private async Task SupplyRecentInventoryStatusAsync(Offer offer)
 {
     if (offer == null || offer.ProductOffers == null || offer.ProductOffers.ProductOffer == null ||
         offer.ProductOffers.ProductOffer.Length == 0)
         return;
     var prods = offer.ProductOffers.ProductOffer.Select(prodOffer => prodOffer.Product).ToList();
     var catApi = new CatalogApi();
     await catApi.SupplyRecentInventoryStatusAsync(prods).ConfigureAwait(false);
 }