2014-07-16 39 views
0

是否可以在同一個odata查詢中使用$ expand,skip和top?

example : /product.svc/App('scscascscasc')/App? 
    $select=AppID,Platforms&$expand=Platforms&$format=json 

回答

2

如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) 
0

可以使用任何查詢選項(一個或多個的值)在一個odata查詢中。

這是服務器關於如何應用這些查詢選項的決定。

對於$ expand,$ skip和$ top,在一個odata查詢中使用它們是可能的也是合理的。

HttpGet ~/Customers?$expand=Orders&$skip=5&$top=6

但最終,例如請求需要從服務器側支撐正如我上面所說。