コード例 #1
0
ファイル: Customer.cs プロジェクト: xhafan/eshop-coreddd
        public virtual Order PlaceOrder()
        {
            Guard.Hope(!string.IsNullOrWhiteSpace(DeliveryAddress), "Deliver address is not set");

            var order = new Order(_basketItems, DeliveryAddress);
            _basketItems.Clear();
            return order;
        }
コード例 #2
0
 protected override void PersistenceContext()
 {
     _product = new ProductBuilder().Build();
     var customer = new CustomerBuilder()
         .WithProductInBasket(_product, ProductQuantity)
         .WithDeliveryAddress()
         .Build();
     _order = new OrderBuilder()
         .WithCustomer(customer)
         .Build();
     Save(_product, _order);
 }
コード例 #3
0
 protected override void PersistenceQuery()
 {
     _retrievedOrder = Get<Order>(_order.Id);
 }