예제 #1
0
        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));
        }
예제 #2
0
        public IHttpActionResult GetAllPartsByProductId(int productId)
        {
            var parts = partProductService.GetAllPartsOfProduct(productId);

            if (parts == null)
            {
                return(NotFound());
            }

            return(Ok(parts));
        }