private ShoppingCart GetShoppingCart()
        {
            var shoppingCart = (ShoppingCart)HttpContext.Session[CART_SESSION_KEY];
            if (shoppingCart == null)
            {
                shoppingCart = new ShoppingCart();
                HttpContext.Session[CART_SESSION_KEY] = shoppingCart;
            }

            return shoppingCart;
        }
Exemplo n.º 2
0
 public OrderRepository(AppDbContext appDbContext, ShoppingCart shoppingCart)
 {
     _appDbContext = appDbContext;
     _shoppingCart = shoppingCart;
 }