I currently have something like this
object t = JsonConvert.DeserializeObject(mystring);
Now when I browse it, it has a property "Root" which has a string in it that I need. How do I access that property?
I currently have something like this
object t = JsonConvert.DeserializeObject(mystring);
Now when I browse it, it has a property "Root" which has a string in it that I need. How do I access that property?
You can simply use a POCO
class:
public class Poco
{
[JsonProperty("Root")]
public string Root { get; set; }
}
Then you can deserialize your JSON to this specified type and access their properties, something like this:
var root = (JsonConvert.DeserializeObject<Poco>(mystring)).Root;