I'm having difficulty deserializing a JSON. I'm getting the following content:
"response":{
"account":{
"name":"Evandro Teste",
"owners":[],
"creationDate":"2017-07-07T07:18PDT",
"city":"Guarulhos",
"description":"",
"state":"São Paulo",
"accountId":45,
"lastUpdated":"2017-07-07T07:18PDT",
"phone":"+55111231233",
"country":"",
"parentId":-1,
"industry":"Teste",
"address":"Rua Teste",
"relationshipUrls":{
"owners":"http://localhost/v1/object/account/45/owners",
"attachments":"http://localhost/v1/object/account/45/attachment",
"comment":"http://localhost/v1/object/account/45/comment",
"contactlog":"http://localhost/v1/object/account/45/contactlog",
"historylog":"http://localhost/api/v1/object/account/45/historylog"
}
}
},
"status":{
"success":true,
"detail":{}
}
My problem is how do I deserialize this JSON by ignoring the response. That is, I need to create an object of type Account, ignoring the response (which returns in Json).
I'm using Restsharp and trying to do the same using JavaScriptSerializer too.
Below is my entity:
public class Account
{
public string name { get; set; }
public string creationDate { get; set; }
public string city { get; set; }
public string description { get; set; }
public string state { get; set; }
public string fax { get; set; }
public int accountId { get; set; }
public string lastUpdated { get; set; }
public string mapQuest { get; set; }
public string phone { get; set; }
public string country { get; set; }
public int parentId { get; set; }
public string googleSearch { get; set; }
public string linkedInSearch { get; set; }
public string industry { get; set; }
public string address { get; set; }
public string AcctType { get; set; }
public string websiteURL { get; set; }
public string zipCode { get; set; }
}