我正在尝试查询OData,我正在扩展一个孩子的孩子。
据我了解,查询应如下所示:
promopages?sf_culture = zh-CN&$ expand = promopagebanners($ expand = promoimage)
在我的情况下,促销与他们的子promopagebanners一起返回,但是每个promopagebanner的promoimage子视图如下:
"PromoImage": {
"Id": "00000000-0000-0000-0000-000000000000",
"LastModified": "0001-01-01T00:00:00Z",
"PublicationDate": "0001-01-01T00:00:00Z",
"Title": null,
"Description": null,
"DateCreated": "0001-01-01T00:00:00Z",
"Ordinal": 0,
"UrlName": null,
"Author": null,
"Extension": null,
"MimeType": null,
"TotalSize": 0,
"Category": [],
"Tags": [],
"Width": 0,
"Height": 0,
"AlternativeText": null,
"FolderId": null,
"ParentId": "00000000-0000-0000-0000-000000000000",
"Url": null,
"ThumbnailUrl": null
}
如果我直接查询promopagebanners并展开promoimage,则会返回预期结果,即上面的对象没有null,0等。