private IDictionary <Guid, IList <ProductDocument.PriceItem> > BuildPriceData(Context context)
        {
            var countries = _countryService.GetAll().ToDictionary(x => x.SystemId, x => x.TaxClassLinks?.FirstOrDefault(x => x.TaxClassSystemId == context.BaseProduct.TaxClassSystemId)?.VatRate ?? x.StandardVatRate);

            return(context.UsedVariants.ToDictionary(x => x.SystemId, x => (IList <ProductDocument.PriceItem>)GetVariantPrices(x).ToList()));

            IEnumerable <ProductDocument.PriceItem> GetVariantPrices(Variant variant)
            {
                foreach (var price in _priceListItemService.GetByVariant(variant.SystemId).Where(z => z.MinimumQuantity == 0))
                {
                    var priceList = _priceListService.Get <ProductPriceList>(price.PriceListSystemId);
                    if (priceList == null)
                    {
                        continue;
                    }

                    foreach (var country in countries)
                    {
                        var vatRate = country.Value;
                        yield return(new ProductDocument.PriceItem
                        {
                            IsCampaignPrice = false,
                            SystemId = priceList.SystemId,
                            Price = priceList.IncludeVat ? price.Price : price.Price * (1 + vatRate),
                            CountrySystemId = country.Key
                        });
                    }
                }
            }
        }
        private ODataProductModel MapVariant(BaseProduct baseProduct, Variant variant)
        {
            var prices = priceListItemService.GetByVariant(variant.SystemId).ToDictionary(p => priceListService.Get(p.PriceListSystemId).Id, r => r.Price);

            return(new ODataProductModel(baseProduct, variant, prices));
        }