private static async Task CreateTestContext(InWordsDataContext context) { await context.AddAccount(1); context.Languages.AddLanguages(); int word1 = context.AddWordPair("test", "Тест"); int word2 = context.AddWordPair("tes2", "Тест2"); int word3 = context.AddWordPair("test3", "Тест3"); HashSet <GameLevelWord> gameLevelWords = new HashSet <GameLevelWord> { new GameLevelWord() { WordPairId = word1 }, new GameLevelWord() { WordPairId = word2 } }; HashSet <GameLevel> gameLevels = new HashSet <GameLevel> { new GameLevel() { GameLevelWords = gameLevelWords, } }; Game game = new Game() { CreatorId = 0, GameLevels = gameLevels }; context.Games.Add(game); await context.SaveChangesAsync(); }