Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StockQuotesResultDto
- {
- [JsonProperty("Meta Data")]
- public MetaData MetaData { get; set; }
- [JsonProperty("Stock Quotes")]
- public StockQuoteDto[] StockQuotes { get; set; }
- }
- //[Preserve(AllMembers = true)]
- public class MetaData
- {
- [JsonProperty("1. Information")]
- public string Information { get; set; }
- [JsonProperty("2. Notes")]
- public string Notes { get; set; }
- [JsonProperty("3. Time Zone")]
- public string TimeZone { get; set; }
- }
- //[Preserve(AllMembers = true)]
- public class StockQuoteDto
- {
- [JsonProperty("1. symbol")]
- public string Symbol { get; set; }
- [JsonProperty("2. price")]
- public string Price { get; set; }
- [JsonProperty("3. volume")]
- public string Volume { get; set; }
- [JsonProperty("4. timestamp")]
- public string Timestamp { get; set; }
- }
- {
- "Meta Data": {
- "1. Information": "Batch Stock Market Quotes",
- "2. Notes": "IEX Real-Time Price provided for free by IEX (https://iextrading.com/developer/).",
- "3. Time Zone": "US/Eastern"
- },
- "Stock Quotes": [
- {
- "1. symbol": "MSFT",
- "2. price": "100.2500",
- "3. volume": "--",
- "4. timestamp": "2018-06-22 15:59:57"
- },
- {
- "1. symbol": "FB",
- "2. price": "201.4100",
- "3. volume": "--",
- "4. timestamp": "2018-06-22 15:59:59"
- },
- {
- "1. symbol": "AAPL",
- "2. price": "185.3900",
- "3. volume": "--",
- "4. timestamp": "2018-06-22 16:01:08"
- }
- ]
- }
- StockQuotesResultDto stockQuotes = JsonConvert.DeserializeObject<StockQuotesResultDto>(contentAsString);
Add Comment
Please, Sign In to add comment