public IHttpActionResult Put(Sensor sensor) { var sensorToUpdate = _sensorService.GetById(sensor.Id); if (sensorToUpdate == null) { return(NotFound()); } sensorToUpdate.Status = sensor.Status; _sensorService.Update(sensorToUpdate); return(Ok(sensorToUpdate)); }
public async Task <ActionResult <SensorResponse> > GetById(Guid id) { var result = await _service.GetById(id); if (result == null) { return(NotFound()); } return(Ok(_converter.ToSensorResponse(result))); }