string jsonData = @"{
'FirstName':'Pietie',
'LastName':'Massimo'
}";
var details = JObject.Parse(jsonData);
var firstName = details["FirstName"]
or
dynamic details = JObject.Parse(jsonData);
var firstName = details.FirstName;
using System;
using Newtonsoft.Json.Linq;
namespace testClient
{
class Program
{
static void Main()
{
var myJsonString = "{report: {Id: "aaakkj98898983"}}";
var jo = JObject.Parse(myJsonString);
var id = jo["report"]["Id"].ToString();
Console.WriteLine(id);
Console.Read();
}
}
}
//You want to convert it to an object first and then
//access normally making sure to cast it.
JObject obj = JObject.Parse(json);
string name = (string) obj["Name"];