using System; namespace Tanshu.Accounts.Contracts { public enum BillItemType { Product, Kot, Information, Total } public class BillItemKey { private BillItemKey(Guid productID, Guid kotID, BillItemType billItemType) { BillItemType = billItemType; ProductID = productID; KotID = kotID; } public BillItemKey(Guid kotID) : this(Guid.Empty, kotID, BillItemType.Kot) { } public BillItemKey(Guid productID, Guid kotID) : this(productID, kotID, BillItemType.Product) { } private Guid _productID; public Guid ProductID { get { return BillItemType == BillItemType.Product ? _productID : Guid.Empty; } private set { _productID = BillItemType == BillItemType.Product ? value : Guid.Empty; } } public Guid KotID { get; private set; } public BillItemType BillItemType { get; private set; } } }