Esempio n. 1
0
        protected Product(string name, string description, int price)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Name must be given", nameof(name));
            }
            if (string.IsNullOrWhiteSpace(description))
            {
                throw new ArgumentException("Description must be given", nameof(description));
            }

            ProductInformation = new ProductInformation(name, description);
            Price = price;
        }
Esempio n. 2
0
        protected Product(string name, int price)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Name must be given", nameof(name));
            }
            if (price <= 0)
            {
                throw new ArgumentException("Price must be above 0", nameof(price));
            }

            ProductInformation = new ProductInformation(name);
            Price = price;
        }
Esempio n. 3
0
 public void UpdateDescription(string description)
 {
     ProductInformation.UpdateDescription(description);
 }
Esempio n. 4
0
 public void UpdateName(string name)
 {
     ProductInformation.UpdateName(name);
 }