using BasicSample.Core.Utils; namespace BasicSample.Core.Domain { /// <summary> /// Encapsulates a historical summary of a particular product ordered. Note that this isn't a /// <see cref="DomainObject{TId}" />, just a POCO value object. Furthermore, since it's a value /// object, it's immatable after construction. /// </summary> public class HistoricalOrderSummary { public HistoricalOrderSummary(string productName, int totalQuantity) { Check.Require(totalQuantity >= 0, "totalQuantity must be >= 0 but was " + totalQuantity.ToString()); Check.Require(!string.IsNullOrEmpty(productName), "productName may not be null or empty"); this.productName = productName; this.totalQuantity = totalQuantity; } public string ProductName { get { return productName; } } public int TotalQuantity { get { return totalQuantity; } } public override string ToString() { return "Product: " + ProductName + "; Quantity: " + TotalQuantity; } private string productName; private int totalQuantity; } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)