Beispiel #1
0
        // When a user has logged in, migrate their shopping cart to
        // be associated with their username
        public void MigrateCart(string userName)
        {
            //var shoppingCart = storeDB.Carts.Where(c => c.CartId == ShoppingCartId);

            var shoppingCart = Cart.FindByCartId(ShoppingCartId);

            foreach (Cart item in shoppingCart)
            {
                item.CartId = userName;
                item.Save();
            }
        }
Beispiel #2
0
 public IEnumerable <Cart> GetCartItems()
 {
     return(Cart.FindByCartId(ShoppingCartId));
 }