Codit / practical-api-guidelines

Practical guidelines for building & designing APIs with .NET.
MIT License
16 stars 5 forks source link

Ad `Sell` method on the `Customization` type #95

Closed MassimoC closed 5 years ago

MassimoC commented 5 years ago

IMO, there should be a method call Sell on the Customization type which decreases InventoryLevel and increases NumberSold atomically. This would be a better way to encapsulate the logic that you want to expose with your model and prevents that someone increases NumberSold without decreasing the inventorylevel

_Originally posted by @fgheysels