Exemplo n.º 1
0
        public int AddCart(CartViewModel c)
        {
            Cart cart = new Cart()
            {
                Id    = c.Id,
                Email = c.Email,
                price = c.Price
            };

            _cartRepo.AddCart(cart);
            return(cart.Id);
        }
        public void AddCart(Guid productId, string email, int qty)
        {
            Cart cart = _cartsRepo.GetCart(productId, email);

            if (cart == null)
            {
                qty = 1;
                _cartsRepo.AddCart(new Cart()
                {
                    email     = email,
                    productId = productId,
                    quantity  = qty
                });
            }
            else
            {
                UpdateQtyInCart(email, productId, qty);
            }
        }
Exemplo n.º 3
0
        public void AddCart(CartViewModel c)
        {
            var newCart = _mapper.Map <CartViewModel, Cart>(c);

            _repo.AddCart(newCart);
        }
Exemplo n.º 4
0
 public void AddToCart(CartViewModel item)
 {
     _cartsRepo.AddCart(_autoMapper.Map <Cart>(item));
 }