public async Task <ActionResult <ActuatorResponse> > Put(Guid id, [FromBody] ActuatorRequest request)
        {
            var result = await _service.Update(id, _converter.ToActuatorValue(request));

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(_converter.ToActuatorResponse(result)));
        }
 public async Task <ActionResult <ActuatorResponse> > Post([FromBody] ActuatorRequest request)
 {
     return(Ok(_converter.ToActuatorResponse(await _service.Create(_converter.ToActuatorValue(request)))));
 }
Esempio n. 3
0
 public ActuatorValue ToActuatorValue(ActuatorRequest actuatorRequest)
 {
     return(new ActuatorValue(actuatorRequest.Position, actuatorRequest.Type));
 }