public IActionResult GetProductbyName2(String id) { var product = _IProductRepository.SelectByName(id); var mp = _IManufacturingPlanRepository.Select(product.ManufacturingPlan.Id); var sum = 0; foreach (OperationsMDP op in mp.Operations) { sum += op.Duration; } return(Ok(ProductsDTO2.generateDto(product, sum))); }
public ActionResult <ManufacturingPlanDTO> GetManufacturingPlan(int id) { var manufacturingPlan = _IManufacturingPlanRepository.Select(id); return(Ok(ManufacturingPlanDTO.generateDto(manufacturingPlan))); }