public async Task <IActionResult> Edit(int id, [Bind("Identifier,DateOfProduction,Model,Tested,TestResult,Gauge")] EndpointDevice endpointDevice) { if (id != endpointDevice.Identifier) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(endpointDevice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EndpointDeviceExists(endpointDevice.Identifier)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(endpointDevice)); }
public int UpdateUser([FromBody] UserMaster user) { _context.Update(user); return(_context.SaveChanges()); }