I have an API JSON response that wraps the data content in a data
property, which looks like this:
{
\"d
You can create an object like this:
public class Data
{
public string email { get; set; }
public string mobile { get; set; }
public int id { get; set; }
public string first_name { get; set; }
public string last_name { get; set; }
public string role { get; set; }
}
public class RootObject
{
public Data data { get; set; }
}
then
var data = JsonSerializer.Deserialize(JsonData);
then you can access the data like the following:
RootObject.Data.email ;
RootObject.Data.first_name
Also, anytime you need to convert JSON string to C# POCO class you can use a tool like this : http://json2csharp.com/