Newtonsoft.Json을 사용하여 json을 비 직렬화합니다. 여기 내 json 문자열입니다.json 객체를 문자열로 참조 할 때 RuntimeBinderExeption
{
"data": {
"type": "records",
"id": "7",
"attributes": {
"created": "2017-01-19T08:42:56Z",
"updated": "2017-01-19T08:42:56Z",
"state": 3,
"data": {
"Lastname": [
"Gonzales"
],
"Firstname": [
"Lacy"
],
"Email": [
"[email protected]"
],
"Salutation": [
"Mrs."
]
}
}
}
}
그래서 이와 같은 동적 변수를 만들고 firstname을 문자열 s에 할당하면 RuntimebinderException이 발생합니다.
dynamic data = JsonConvert.DeserializeObject(responseString2);
string s = data.attributes.data.Firstname;
내가 잊어 버린 것이 있습니까? 귀하의 도움에 감사드립니다