public IEnumerable <HistoricalQuote> Get(HistoricalQuotesParameters @params) { IList <HistoricalQuote> result = new List <HistoricalQuote>(); var data = new HistoricalQuotes.HistoricalQuotes(@params).Download(); var dataSplited = data.Split(RowSeparator, StringSplitOptions.RemoveEmptyEntries); var dataHeaderSplited = dataSplited.First().Split(ColumnSeparator); foreach (var row in dataSplited.Skip(1)) { var dataRowSplited = row.Split(ColumnSeparator); var quote = new HistoricalQuote(); for (var i = 0; i < dataRowSplited.Length; i++) { quote.SetPropertyValue(dataHeaderSplited[i], dataRowSplited[i]); } result.Add(quote); } return(result); }
public IEnumerable<HistoricalQuote> Get(HistoricalQuotesParameters @params) { IList<HistoricalQuote> result = new List<HistoricalQuote>(); var data = new HistoricalQuotes.HistoricalQuotes(@params).Download(); var dataSplited = data.Split(RowSeparator, StringSplitOptions.RemoveEmptyEntries); var dataHeaderSplited = dataSplited.First().Split(ColumnSeparator); foreach (var row in dataSplited.Skip(1)) { var dataRowSplited = row.Split(ColumnSeparator); var quote = new HistoricalQuote(); for (var i = 0; i < dataRowSplited.Length; i++) { quote.SetPropertyValue(dataHeaderSplited[i], dataRowSplited[i]); } result.Add(quote); } return result; }