private void LoadOrderItemsForOrder(Order order) { foreach (var orderItem in order.Items) { orderItem.Product = _products.WithId(orderItem.ProductId); } }
public ActionResult <ViewModel <Product> > GetProductbyId([FromQuery] int id) { var product = _products.WithId(id); if (product is null) { return(NoContent()); } var vm = ProductViewModel.From(Request, product); return(Ok(vm)); }