Я хочу взять только id, medicareNumber и ogrn. Но говорит что: System.NullReferenceException: "Ссылка на объект не указывает на экземпляр объекта."
WSDLTest.PracticeLocation.identification.get вернул null.
Что я делаю не так?
class PracticeLocation
{
public Identification identification { get; set; }
}
class Identification
{
public int Id { get; set; }
public int MedicareNumber { get; set; }
public int Ogrn { get; set; }
}
PracticeLocation practiceLocation = JsonConvert
.DeserializeObject<PracticeLocation>(result.RequestMessage);
Console.WriteLine(
"Temperature in {0}: {1} C and {2}",
practiceLocation.identification.Id,
practiceLocation.identification.MedicareNumber,
practiceLocation.identification.Ogrn);`
result.RequestMessage
:
{
"practiceLocation":{
"identification":{
"id":"101",
"medicareNumber":"101",
"ogrn":"1681745",
"okato":null,
"okpo":null
},
"businessName":"Городская клиническая больница №1 г. . Поликлиника №1",
"licence":{
"licenceNumber":"ЛО-31-01-70",
"licenceStartDate":"2019-02-08 00:00:00",
"licenceEndDate":null,
"licenceAdministrator":"Бюджетное учреждение"
},
"address":{
"kladrCode":null,
"addressText":" область, г. , проспект, 95а",
"postalCode":"308"
},
"communicationNumbers":{
"primaryTelephone":{
"number":"+747222",
"extension":null,
"supportsSMS":null
},
"electronicMail":[
],
"otherTelephone":[
]
}
},
"softwareInformation":null
}