This question is asked many times but the answers do not fit my needs. I have a sample JSON string which is an JSON array. I want to parse it and be able to choose what values to print
In my first class I download the JSON into string and parse it using jsonConvert.DeserializeObject
using Newtonsoft.Json;
namespace JSON_parser_2
{
class Program
{
static void Main(string[] args)
{
WebClient client = new WebClient();
string downloadedString = client.DownloadString("https://jsonplaceholder.typicode.com/posts");
var result = JsonConvert.DeserializeObject<jsonStorage>(downloadedString);
The "JsonStorage" is the class in which I defined the following
public string userId { get; set; }
public string id { get; set; }
public string title { get; set; }
public string body { get; set; }
Now, In my first class I want to print this whole parsed JSON or only title or body, how can I do it? Ultimately, I want to print all sample comments from a given link.
>`.
– Joe Mar 14 '17 at 22:04