public void RemoveGame(int gameId) { var removeWhat = AllChannelsCollection.FirstOrDefault(kgc => kgc.ChannelId == gameId); if (removeWhat != null) { AllChannelsCollection.Remove(removeWhat); } // Old: Games.RemoveAll(kgi => kgi.ChannelId == gameId); Challenges.RemoveAll(kgi => kgi.ChannelId == gameId); }
public void UpdateGames(GameChannel[] games, KgsConnection connection) { foreach (var g in games) { var existingGame = AllChannelsCollection.FirstOrDefault(kgc => kgc.ChannelId == g.ChannelId); if (existingGame != null) { existingGame.UpdateFrom(g); } else { AddChannel(g, connection); } } }