public virtual Order PlaceOrder() { Guard.Hope(!string.IsNullOrWhiteSpace(DeliveryAddress), "Deliver address is not set"); var order = new Order(_basketItems, DeliveryAddress); _basketItems.Clear(); return order; }
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); }
protected override void PersistenceQuery() { _retrievedOrder = Get<Order>(_order.Id); }