I have JSON object in below format.
[
{
"checked":true,
"discipline":"Registered Nurse",
"disciplineId":1,
"specialty":"OR",
"specialtyId":7
},
{
"checked":true,
"discipline":"Registered Nurse",
"disciplineId":1,
"specialty":"Ambulatory OR",
"specialtyId":62
},
{
"checked":true,
"discipline":"Registered Nurse",
"disciplineId":1,
"specialty":"Pedi-OR",
"specialtyId":101
}
]
I would like to map the properties in below format using C#. JSON object is coming through Reader.
jobPreferencesEvent.preferred_discipline =
reader["discipline"] != DBNull.Value ? reader["discipline"].ToString() : "0";
jobPreferencesEvent.preferred_specialty =
reader["speciality"] != DBNull.Value ? reader["speciality"].ToString() : "0";
Could someone help me on it?