private void AddUpdateGameUser(int gameId) { string currentUserId = User.FindFirst(ClaimTypes.NameIdentifier).Value; GameUser gameUser = _gameUserService.Get(x => x.UserId == currentUserId); if (gameUser == null) { gameUser = new GameUser { GameId = gameId, UserId = currentUserId, LastPlayedDate = DateTime.UtcNow }; _gameUserService.Add(gameUser); } else { gameUser.LastPlayedDate = DateTime.UtcNow; _gameUserService.Update(gameUser); } }