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; }
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; }
public void UpdateDescription(string description) { ProductInformation.UpdateDescription(description); }
public void UpdateName(string name) { ProductInformation.UpdateName(name); }