Example #1
0
        public ActionResult <ProductionLine> PostProductionLine(ProductionLine productionLine)
        {
            _productionLineRepository.Add(productionLine);
            _productionLineRepository.SaveChanges();

            return(CreatedAtAction(nameof(GetProductionLine), new { id = productionLine.Id }, productionLine));
        }
Example #2
0
        public ActionResult <ProductionLine> PostProductionLine(ProductionLineDTO DTO)
        {
            ProductionLine productionLine = new ProductionLine(DTO.Name);

            productionLine.Machines = DTO.Machines;
            _productionLineRepository.Add(productionLine);
            _productionLineRepository.SaveChanges();

            return(CreatedAtAction(nameof(GetProductionLine), new { id = productionLine.Id }, productionLine));
        }