private void CheckPricingLoaders(ContentReference contentReference, CustomerPricing customerPricing)
        {
            // The one to use when using "custom" price-types
            PricingLoader RwLoader = new PricingLoader(
                contentLoader.Service,
                _priceDetailService, // Note: PriceDetailService
                referenceConverter.Service,
                catalogSystem.Service);

            // Note: the customerPricing arg. handles custom price-types
            ItemCollection <PriceDetail> prices = RwLoader.GetPrices
                                                      (contentReference, MarketId.Default, customerPricing);

            // This one may not be the best choice, it's from 7.5/R3
            // For non-complex scenarios it may be sufficient, or if the inconsistent behaviour is benneficial
            // Several overloads are marked...
            // "Obsolete" - "Use the constructor with currentMarketService instead."
            ReadOnlyPricingLoader RoLoader = new ReadOnlyPricingLoader( //  first overload obsoleted in 9
                contentLoader.Service,
                _priceService,                                          // Note: PriceService
                referenceConverter.Service,
                catalogSystem.Service,
                currentMarket.Service,  // added
                //, Mediachase.Commerce.Security.SecurityContext.Current // Obsoleted
                CustomerContext.Current // added
                //, FrameworkContext.Current // Obsoleted
                );                      // added

            ItemCollection <Price> custPrices = RoLoader.GetCustomerPrices(contentReference);
        }
Ejemplo n.º 2
0
        private void CheckPricingLoaders(ContentReference contentReference, CustomerPricing customerPricing)
        {
            PricingLoader RwLoader = new PricingLoader(contentLoader.Service, _priceDetailService, referenceConverter.Service, catalogSystem.Service);
            ItemCollection <PriceDetail> prices = RwLoader.GetPrices(contentReference, MarketId.Default, customerPricing);

            // Overload is marked "Obsolete" - "Use the constructor with currentMarketService instead."
            ReadOnlyPricingLoader RoLoader = new ReadOnlyPricingLoader( //  first overload obsoleted in 9
                contentLoader.Service
                , _priceService
                , referenceConverter.Service
                , catalogSystem.Service
                , currentMarket.Service   // added
                                          //, Mediachase.Commerce.Security.SecurityContext.Current // added
                , CustomerContext.Current // added
                                          //, FrameworkContext.Current); // added
                );
            // new style
            //ReadOnlyPricingLoader RoLoader2 = new ReadOnlyPricingLoader(
            //    contentLoader.Service
            //    , _priceService
            //    , referenceConverter.Service
            //    , catalogSystem.Service
            //    , currentMarket.Service
            //    , Mediachase.Commerce.Security.SecurityContext.Current
            //    , Mediachase.Commerce.Customers.CustomerContext.Current
            //    , FrameworkContext.Current);
        }