⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 historicalordersummary.cs

📁 NHibernate简单DEMO
💻 CS
字号:
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;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -