private void ProcessRI() { try { AzureRIRateCard rateCard = downloader.DownloadRI(AzureRateCardDownloader.RIType.oneYear).Result; List <RIRateCard> convertedRIRateCardList = new List <RIRateCard>(); foreach (var item in rateCard.Offers) { convertedRIRateCardList.Add(new RIRateCard(item.Key, item.Value)); } uploder.BulkUpload(convertedRIRateCardList, GetAppSetting("DatabaseId"), GetAppSetting("RICollectionId")).Wait(); } catch (Exception e) { Console.WriteLine("Import failed:" + e.Message); } }
private void TestRI() { try { AzureRIRateCard rateCard = downloader.DownloadRI(AzureRateCardDownloader.RIType.oneYear).Result; foreach (var item in rateCard.Offers) { foreach (var region in item.Value.Prices) { var msg = $"{item.Key} - price for {region.Key} is {region.Value.Value}\n"; Console.Write(msg); } } } catch (Exception e) { Console.WriteLine("Import failed:" + e.Message); } }