private static IEnumerable <YahooFinanceStockData> ParseCsvIntoStockQuotes(string csv)
 {
     using (var csvReader = new CsvReader(new StringReader(csv), false))
     {
         while (csvReader.ReadNextRecord())
         {
             var d = new YahooFinanceStockData();
             d.Ticker = csvReader[0];
             decimal.TryParse(csvReader[1], out d.LastTradePrice);
             d.Name   = csvReader[2];
             d.Volume = csvReader[3];
             decimal.TryParse(csvReader[4], out d.Change);
             d.LastTradeTime             = csvReader[5];
             d.RealTimeLastTradeWithTime = csvReader[6];
             d.ChangeRealTime            = csvReader[7];
             yield return(d);
         }
     }
 }
 private static StockQuote MapYahooData(YahooFinanceStockData data)
 {
     if (data == null)
     {
         return null;
     }
     var stock = new StockQuote();
     stock.Name = data.Name;
     stock.LastTradePrice = data.LastTradePrice;
     stock.Ticker = data.Ticker;
     stock.Volume = data.Volume;
     stock.Change = data.Change;
     stock.LastTradeTime = data.LastTradeTime;
     stock.RealTimeLastTradePrice = decimal.Parse(data.RealTimeLastTradeWithTime
         .Replace("<b>", "")
         .Replace("</b>", "")
         .Replace("N/A -", "")
         .Trim()
     );
     stock.ChangeRealTime = data.ChangeRealTime;
     return stock;
 }
        private static StockQuote MapYahooData(YahooFinanceStockData data)
        {
            if (data == null)
            {
                return(null);
            }
            var stock = new StockQuote();

            stock.Name                   = data.Name;
            stock.LastTradePrice         = data.LastTradePrice;
            stock.Ticker                 = data.Ticker;
            stock.Volume                 = data.Volume;
            stock.Change                 = data.Change;
            stock.LastTradeTime          = data.LastTradeTime;
            stock.RealTimeLastTradePrice = decimal.Parse(data.RealTimeLastTradeWithTime
                                                         .Replace("<b>", "")
                                                         .Replace("</b>", "")
                                                         .Replace("N/A -", "")
                                                         .Trim()
                                                         );
            stock.ChangeRealTime = data.ChangeRealTime;
            return(stock);
        }
 private static IEnumerable<YahooFinanceStockData> ParseCsvIntoStockQuotes(string csv)
 {
     using(var csvReader = new CsvReader(new StringReader(csv),false))
     {
         while(csvReader.ReadNextRecord())
         {
             var d = new YahooFinanceStockData();
             d.Ticker = csvReader[0];
             decimal.TryParse(csvReader[1], out d.LastTradePrice);
             d.Name = csvReader[2];
             d.Volume = csvReader[3];
             decimal.TryParse(csvReader[4], out d.Change);
             d.LastTradeTime = csvReader[5];
             d.RealTimeLastTradeWithTime = csvReader[6];
             d.ChangeRealTime = csvReader[7];
             yield return d;
         }
     }
 }