public async Task <IActionResult> Edit(int id, [Bind("Valuekey,Identifier,Sensordata,Datadate,Ipadress")] Sensorvalues sensorvalues) { if (id != sensorvalues.Valuekey) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sensorvalues); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SensorvaluesExists(sensorvalues.Valuekey)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } ViewData["Identifier"] = new SelectList(_context.Sensors, "Identifier", "Identifier", sensorvalues.Identifier); return(View(sensorvalues)); }
public async Task <IActionResult> Edit(string id, [Bind("Identifier,Sensorname,Sensortype,Sensorcomment")] Sensors sensors) { if (id != sensors.Identifier) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sensors); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SensorsExists(sensors.Identifier)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(sensors)); }