private IdToName() { string json; using (var webClient = new WebClient()) { json = webClient.DownloadString("http://api.steampowered.com/ISteamApps/GetAppList/v2"); } SteamApiContainer account = JsonConvert.DeserializeObject <SteamApiContainer>(json); _idToName = account.applist.apps.ToDictionary(o => o.appid, o => o.name); }
private static IReadOnlyDictionary <int, string> GetIdsToNames() { string json; using (var webClient = new WebClient()) { json = webClient.DownloadString("http://api.steampowered.com/ISteamApps/GetAppList/v2"); } SteamApiContainer account = JsonConvert.DeserializeObject <SteamApiContainer>(json); return(account.applist.apps.ToDictionary(o => o.appid, o => o.name)); }