public void LoadPossessionsBackupList() { using (var scope = scopeFactory.CreateScope()) { var db = scope.ServiceProvider.GetRequiredService <DboContext>(); PossessionBackups = mapperBackup.Map <List <PossessionBackup> >(db.PossessionsData); APIFetcher apiFetcher = new APIFetcher(); List <DboPossessionData> List = db.PossessionsData.ToList(); for (var x = 0; x < PossessionBackups.Count; x++) { ApiLink apiLink = new ApiLink { Headers = List.ElementAt(x).Headers, Url = List.ElementAt(x).UrlAPI, Type = List.ElementAt(x).Type }; apiFetcher.AddDownloadEntity(apiLink, (IApiCallback)PossessionBackups.ElementAt(x)); } apiFetcher.RunAllDownloadsAsync(); } }
private static int ParseAPI() { Console.WriteLine("Parsing ROBLOX API..."); try { string downloadLocation = APIFetcher.DownloadROBLOXApi(); if (!string.IsNullOrWhiteSpace(downloadLocation)) { RobloxParser.Parse(downloadLocation); } } catch (Exception e) { Console.WriteLine($"Failed to launch {e.Message}"); Console.ReadKey(); return(-1); } Console.WriteLine("Parsed ROBLOX API"); Console.WriteLine(); return(0); }