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); } }
public void AddCart(CartViewModel c) { var newCart = _mapper.Map <CartViewModel, Cart>(c); _repo.AddCart(newCart); }
public void AddToCart(CartViewModel item) { _cartsRepo.AddCart(_autoMapper.Map <Cart>(item)); }