public async Task SpyDataRepositoryTest() { var setting = new SPYValuationSetting("SPY"); var downloader = new SPYValuationDownloader(setting); var result = await downloader.DownloadObjectStreamTaskAsync().ConfigureAwait(false); setting.Valuationtype = ValuationType.PB; var result2 = await downloader.DownloadObjectStreamTaskAsync().ConfigureAwait(false); var repo = new SpyDataRepository(); repo.Save(@"c:\temp\spy.xml", result, result2); var result_ = repo.Load(@"c:\temp\spy.xml"); //var xmlSerializer = new XmlSerializer(typeof(MetricsDataPointResult)); //using (var reader = XDocument.CreateReader()) //{ // var val = (MetricsDataPointResult)xmlSerializer.Deserialize(reader); //} }
public async Task GetSPYValuationHistoryMetrics() { var setting = new SPYValuationSetting("SPY"); var downloader = new SPYValuationDownloader(setting); var result = await downloader.DownloadObjectStreamTaskAsync().ConfigureAwait(false); foreach (var item in result.Items) { Console.WriteLine("ticker: SPY - {0} Date: {1} Value: {2}", result.MetricsType.ToString(), item.Date, item.Value); } }