Skip to content

Instantly share code, notes, and snippets.

@pjvds
Created June 17, 2010 21:51
Show Gist options
  • Save pjvds/442842 to your computer and use it in GitHub Desktop.
Save pjvds/442842 to your computer and use it in GitHub Desktop.
public class SalesOrderService
{
// A command should map to this method.
public void AddProducToSalesOrder(Guid salesOrderId, Guid productId, int quantity)
{
using(var work = GetUnitOfWork())
{
var order = work.GetById<SalesOrder>(salesOrderId);
var product = work.GetById<Product>(productId);
order.AddProduct(productId, quantity);
product.DecreaseStockCausedBySalesOrderFooBarForgotTheMethodName(salesOrderId);
work.Accept();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment