public async Task <IActionResult> Edit(int id, Game game) { if (id != game.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(game); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GameExists(game.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(game)); }
public async Task UpdateUser(UserModel userModel) { using (var gameDbContext = new GameDbContext(_dbContextOptions)) { gameDbContext.Update(userModel); await gameDbContext.SaveChangesAsync(); } }
public void UpdateToken(RefreshToken token) { context.Update(token); }