public Cart Save(Cart cart)
 {
     using (ITransaction transaction = session.BeginTransaction())
     {
         session.Save(cart);
         transaction.Commit();
     }
     return cart;
 }
Esempio n. 2
0
        public ShopOrder CreateOrder(User user, Cart cart, string address, string city, string zip)
        {
            var orderItems = cart.Items.Select(cartItem => new OrderItem{
                                                    Product = cartItem.Product,
                                                    Quantity = cartItem.Quantity
                                                }).ToList();

            return new ShopOrder
            {
                User = user,
                //OrderItems = orderItems,
                Address = address,
                City = city,
                Zip = zip
            };
        }
 public CartDataBuilder()
 {
     cart = new Cart();
     cart.Items = new List<CartItem>();
 }