public async Task <IActionResult> Edit(long id, [Bind("UserDataModelId,Assignment,Date,Text,Amount")] UserDataModel userDataModel) { if (id != userDataModel.UserDataModelId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userDataModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserDataModelExists(userDataModel.UserDataModelId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(userDataModel)); }
public User UpdateUser(User user) { return(_context.Update(user).Entity); }