Ejemplo n.º 1
0
 public MachineModel Save(MachineModel machineModel)
 {
     if (machineModel.Equals(null))
     {
         return(null);
     }
     return(repository.Save(machineModel));
 }
Ejemplo n.º 2
0
        public IActionResult Save([FromBody] MachineModel element)
        {
            if (element.Equals(null))
            {
                return(BadRequest());
            }

            var machine = machineService.Save(element);

            if (machine.Equals(null))
            {
                return(NotFound());
            }

            return(Ok(Newtonsoft.Json.JsonConvert.SerializeObject(machine)));
        }