public async Task <List <NaceRegionData> > PopulateDB() { var watch = System.Diagnostics.Stopwatch.StartNew(); System.DateTime moment = System.DateTime.Now; EndYear = moment.Year; List <EuroStatTable> tables = await databaseStore.getAllEuroStatTables(); int i = 0; int infoMaxLength = 70; string info; foreach (EuroStatTable table in tables) { info = $"Saving data in database: {(double)i++ * 100 / tables.Count:0.0}% - {table.attributeName} "; Console.Write($"\r{info}{Strings.Space(infoMaxLength - info.Length)}"); await FetchAndStore(table); } info = "Done saving data in database"; Console.WriteLine($"\r{info}{Strings.Space(infoMaxLength - info.Length)}"); watch.Stop(); var elapsedS = watch.ElapsedMilliseconds / 1000; var minutes = elapsedS / 60; var seconds = elapsedS - (minutes * 60); Console.WriteLine("Database populated in: " + minutes + ":" + seconds + " minutes."); return(await databaseStore.getAllNaceRegionData()); }