private List <StockPrice> GetStocks(string[] lines) { var data = new StockPrice(); List <StockPrice> lstStock = new List <StockPrice>(); foreach (var line in lines.Skip(1)) { data = new StockPrice(); string[] content = line.Split(','); data.Date = DateTime.Parse(content[0]); data.High = Double.Parse(content[1]); data.Low = Double.Parse(content[2]); data.Open = Double.Parse(content[3]); data.Close = Double.Parse(content[4]); data.AdjClose = Double.Parse(content[5]); data.Volume = long.Parse(content[6]); lstStock.Add(data); } return(lstStock); }