Example #1
0
        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));
        }
Example #2
0
 public async Task UpdateUser(UserModel userModel)
 {
     using (var gameDbContext = new GameDbContext(_dbContextOptions))
     {
         gameDbContext.Update(userModel);
         await gameDbContext.SaveChangesAsync();
     }
 }
Example #3
0
 public void UpdateToken(RefreshToken token)
 {
     context.Update(token);
 }