コード例 #1
0
        public void RemoveProductFromCart(CartServiceRemoveProductToCartRequest request)
        {
            Product product = _unitOfWork.Products.GetAll().FirstOrDefault(p => p.ProductID == request.ProductId);

            CartServiceAdapter adapter = new CartServiceAdapter(product);

            request.Cart.RemoveLine(adapter.Fill());
        }
コード例 #2
0
        public void AddProductToCart(CartServiceAddProductToCartRequest request)
        {
            Product product = _unitOfWork.Products.GetAll().FirstOrDefault(p => p.ProductID == request.ProductId);

            CartServiceAdapter adapter = new CartServiceAdapter(product);

            request.Cart.AddItem(adapter.Fill(), 1);
        }