public ActionResult Details(int productDtoId) { var productDto = productService.Get(productDtoId); var productViewModel = Mapper.Map <ProductViewModel>(productDto); productViewModel.PartDtos = partProductService.GetAllPartsOfProduct(productDtoId); return(View("ProductDetails", productViewModel)); }
public IHttpActionResult GetAllPartsByProductId(int productId) { var parts = partProductService.GetAllPartsOfProduct(productId); if (parts == null) { return(NotFound()); } return(Ok(parts)); }