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); }
private void ProductUnitPriceChangedEventHandler(ProductUnitPriceChanged e) { _unitPrice = e.UnitPrice; }