Ejemplo n.º 1
0
 public IActionResult Create([FromBody] ItemDto model)
 {
     if (ModelState.IsValid)
     {
         var step = _stepManager.GetById(model.StepId);
         if (step == null)
         {
             return(NotFound($"Step with Id:{model.StepId} not found"));
         }
         model = _itemManager.AddDTO <ItemDto>(model);
         _itemManager.SaveChanges();
         return(Ok(model));
     }
     else
     {
         return(BadRequest(ModelState));
     }
 }