I receive a JObject object form a thoird party service which contains the below shown JSON:
{
{
"topic": "asd",
"id": "b87a5db6-01b5-4cc0-8fa7-832382ca3431",
"eventType": "update",
"subject": "/asd/task",
"eventTime": "12/18/2018 4:46:20 PM",
"data": {
"auditId": "-9223372036854771584",
"contextData": "{}",
"eventType": null,
"auditData": {
"taskId": "22BC1515-39DF-4124-89EB-AD1468572F20",
"user": "asd@ul.com",
**"reminderDate": null,
"startDate": null,
"dueDate": null,**
"taskStatusName": "NotScheduled"
}
},
"dataVersion": "",
"metadataVersion": "1"
}
}
This JObject may or may not have the JTokens which are highlighted in bold.
I need to see if such JTokens are present in the incoming JObject or not.
If they are present, then I need to take values from them. For e.g. here reminderDate, startDate and dueDate JTokens are present so I need to fetch their respective values which is null for this example.
If these Jtokens are not present in JObject, then I need to take the values from some other source (like DB).