Exemple #1
0
        public ActionResult Details(int partDtoId)
        {
            var partDto       = partService.Get(partDtoId);
            var partViewModel = Mapper.Map <PartViewModel>(partDto);

            partViewModel.ProductDtos = partProductService.GetAllProductsWithPart(partDtoId);

            return(View("PartDetails", partViewModel));
        }
Exemple #2
0
        public IHttpActionResult GetAllProductsByPartId(int partId)
        {
            var products = partProductService.GetAllProductsWithPart(partId);

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

            return(Ok(products));
        }