예제 #1
0
        public void SetProductImages(List <ProductImage> productImages, string imageUrlPattern)
        {
            // first set default product image
            Product.DefaultImage = GetImageUrl(Product.DefaultImage, imageUrlPattern);

            // now set optional images
            if (productImages.Any())
            {
                ProductImages = productImages.Where(p => p.ProductId == Product.ProductId).ToList();
                ProductImages.ForEach(i => i.Image = GetImageUrl(i.Image, imageUrlPattern));
            }
        }