我不知道为什么集合值导航属性总是返回一个空列表,并带有对实际数据链接的引用。
这是我尝试的查询:
GET <organization>/api/data/v8.0/new_subjectareas?$expand=new_product_new_subjectarea&$count=true
回复 :
{
"@odata.context":"<organization>/api/data/v8.0/$metadata#new_subjectareas",
"@odata.count":150,
"value":[
{
"@odata.etag":"W/\"9644599\"",
"timezoneruleversionnumber":null,
"processid":null,
"_stageid_value":null,
"new_product_new_subjectarea":[],
"[email protected]":"<organization>/api/data/v8.0/new_subjectareas(622bcca9-8946-e511-80fb-00155d002810)/new_product_new_subjectarea"
},
....
如何在导航属性(new_product_new_subjectarea)中获取项目,而又不对其引用进行任何新请求([email protected])?
您看到的行为是“设计使然”的(即使有人可能会认为这种特定的设计选择值得怀疑)。
展开具有集合值的导航属性时,将始终获得一个空数组和一个[relation name]@odata.nextLink
属性。当前,如果没有其他请求,就无法获取实际的关系行。
资料来源:官方文档中的示例。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句