// Deserialise the comments public static object DeserialiseComments(string comments) { HackerNewsComment comment = JsonConvert.DeserializeObject <HackerNewsComment>(comments); Console.WriteLine(comment); return(comment); }
// Get associated comments public void GetComments() { // Print the 5 first comments foreach (var kid in this.kids.Take(5)) { string url = string.Format("https://hacker-news.firebaseio.com/v0/item/{0}.json?print=pretty", kid); // Uncomment below to print raw results of the comment //Console.WriteLine(Program.CallRestMethod(url)); HackerNewsComment.DeserialiseComments(Program.CallRestMethod(url)); } }