Json Path-在线工具返回有效值时SelectToken返回null
JSonObjject
{ "Events": [ {
"EventDateTime": "2018-07-08T15:15:38.4040235+10:00",
"EventType": "MessageReceived",
"MessageType": "SlideState",
"Message": {
"Slide": {
"Barcode": "-!!!",
"SlideId": 11,
"VisibleSlideId": "00000012"
},
"Id": "00000000-0000-0000-0000-000000000000"
}
}
]}
Json路径: $ .Events [?(@。MessageType =='SlideState')]。Message .. [?(@。VisibleSlideId == '00000012')] ..条形码
http://jsonpath.com/,当尝试评估Jsonpath时。返回有效的条形码。
但是当我使用C#code时,返回null。
propertyName =“ $ .Events [?(@。MessageType =='SlideState')]。Message .. [? (@ .VisibleSlideId =='00000012')] ..条形码“
actualValue = actualJson.SelectToken(propertyName, true);
有人可以帮我吗