public IActionResult Product(int id) { Product product = productContainer.GetByID(id); ProductViewModel productView = ProductMapper.ProductViewModel(product); return(View(productView)); }
public IActionResult AddProduct(int aantal, int productId) { int orderId = GetSessionOrderId(); Order order = orderContainer.GetByID(orderId); Product product = productContainer.GetByID(productId); OrderRegel orderRegel = new OrderRegel(aantal, product); order.EditOrderRegel(orderRegel); ProductViewModel productView = ProductMapper.ProductViewModel(product); return(RedirectToAction("Product", "Products", productView)); }