public async Task <IActionResult> PutMedicion(long id, Medicion medicion) { if (id != medicion.MedicionId) { return(BadRequest()); } _context.Entry(medicion).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MedicionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDispositivo(long id, Dispositivo dispositivo) { if (id != dispositivo.DispositivoId) { return(BadRequest()); } _context.Entry(dispositivo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DispositivoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLog(string id, Log log) { if (id != log.LogId) { return(BadRequest()); } _context.Entry(log).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LogExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutSensor(long id, Sensor sensor) { if (id != sensor.SensorId) { return(BadRequest()); } _context.Entry(sensor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SensorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }