public ProductDTO CreateProductDTO(ProductService.ProductDTO product) { ProductDTO result = new ProductDTO() { Name = product.Name, ProductID = product.ProductID, ListPrice = product.ListPrice }; return(result); }
public RedirectToRouteResult RemoveFromCart(ShopCartItemServiceClient cart, int productId, string returnUrl) { Factory factory = new Factory(); ProductService.ProductDTO product = productService.GetProduct(productId); var productDTO = factory.CreateProductDTO(product); if (productDTO != null) { cart.RemoveLine(productDTO); } return(RedirectToAction("Index", new { returnUrl })); }