是否可以在同一個odata查詢中使用$ expand,skip和top?
example : /product.svc/App('scscascscasc')/App?
$select=AppID,Platforms&$expand=Platforms&$format=json
是否可以在同一個odata查詢中使用$ expand,skip和top?
example : /product.svc/App('scscascscasc')/App?
$select=AppID,Platforms&$expand=Platforms&$format=json
如OData的網站描述
http://host/service/Products?$top=5&$skip=2
所述擴展的實體可以進一步通過擴大選擇的應用程序精製而成,表示爲系統查詢選項的分號分隔的列表,用括號括起來,請參閱[OData-URL]。允許的系統查詢選項包括$ filter,$ select,$ orderby,$ skip,$ top,$ count,$ search,$ expand和$ levels。
實施例38:爲客戶實體集內的每個客戶實體,那些相關聯的訂單,其量大於100將被內聯表示
http://host/service.svc/Customers?$expand=Orders($filter=Amount gt 100)
可以使用任何查詢選項(一個或多個的值)在一個odata查詢中。
這是服務器關於如何應用這些查詢選項的決定。
對於$ expand,$ skip和$ top,在一個odata查詢中使用它們是可能的也是合理的。
如HttpGet ~/Customers?$expand=Orders&$skip=5&$top=6
但最終,例如請求需要從服務器側支撐正如我上面所說。
根據OData Spec V4,在$ expand中支持$ skip和$ top,但沒有具體的項目表示$ expand支持混合$ stip和$ top。 http://services.odata.org/V4/TripPinService/Me?$ expand =好友($ top = 4)可以按照規範工作。