Beispiel #1
0
        public override string ToString()
        {
            var message = "Product Name = " + ProductName + " Product Code = " + ProductCode + " with ID " + Id;

            if ((ProductImages != null) && ProductImages.Any())
            {
                message += " Total Photos " + ProductImages.Count();
            }

            return(message);
        }
Beispiel #2
0
        public void AddImage(string url, int order)
        {
            if (ProductImages.Any(x => x.ShowOrder == order))
            {
                throw new BusinessException($"Image order already defined for Product:{Id}");
            }

            RaiseEvent(
                ProductImage.ImageAddedToProduct(this, url, order)
                );
        }