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 IHttpActionResult Post(Sensor sensor) { return Ok(_sensorService.Add(sensor)); }