I want to parse/Deserilize JSon respones in C#, the Json looks as the one below:
{ "BusinessUnitId": "", "CorrelationId": "", "Depth": 1, "InitiatingUserAzureActiveDirectoryObjectId": "", "InitiatingUserId": "", "InputParameters": [ { "key": "Target", "value": { "__type": "Entity:http://schemas.microsoft.com/xrm/2011/Contracts", "Attributes": [ { "key": "firstname", "value": "" }, { "key": "lastname", "value": "" }, ...
how can I get the field value such as firstname, lastname..? when using this approach still can't find the value by key
public class Employee { public string empNumber { get; set; } public Address homeAddress { get; set; } public IList aliasNames { get; set; } } public class Address { public string line1 { get; set; } public string line2 { get; set; } } public class Names { public string firstName { get; set; } public string lastName { get; set; } }
Employee objOD = JsonConvert.DeserializeObject(respJSON);