示例#1
0
        public void ChangeUnitPrice(Decimal unitPrice)
        {
            if(_unitsInStock > 0)
            {
                throw new InvalidOperationException("Cannot change unit price while there are still units in stock.");
            }

            var e = new ProductUnitPriceChanged(Id, unitPrice);
            ApplyEvent(e);
        }
示例#2
0
 private void ProductUnitPriceChangedEventHandler(ProductUnitPriceChanged e)
 {
     _unitPrice = e.UnitPrice;
 }