public SalesOrder(IDomainEventRaiser observer, CustomerId customer, RefWarehouseId warehouse) { _observer = observer; if (customer == null) { throw new Exception("Customer id cannot be null"); } if (warehouse == null) { throw new Exception("Warehouse id cannot be null"); } Id = new SalesOrderId(Guid.NewGuid()); Customer = customer; _warehouse = warehouse; Status = Status.CreateOpened(); Lines = new Lines(Id, ref _status); }
public void ChangeWarehouse(RefWarehouseId warehouse) { Warehouse = warehouse; }