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()); }
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); }