protected Product(ProductGroup productGroup, string name, decimal?listPrice, string description) : this() { if (productGroup == null) { throw new ArgumentNullException(nameof(productGroup)); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException(nameof(name)); } ProductGroup = productGroup; Name = name; ListPrice = listPrice; DateCreated = DateTime.Now; Description = description; }
public static Product Create(ProductGroup productGroup, string name, decimal?listPrice, string description) { return(new Product(productGroup, name, listPrice, description)); }