Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public void ChangeWarehouse(RefWarehouseId warehouse)
 {
     Warehouse = warehouse;
 }