【问题标题】:How do I skip, select, top on the $expand in OData?如何在 OData 中的 $expand 上跳过、选择、置顶?
【发布时间】:2016-11-22 15:06:06
【问题描述】:

如何在 OData 中跳过、选择、置顶 $expand?为什么以下不起作用?

http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($select=Emails&$top=1&$skip1)

但如果我在展开时只使用$select$top$skip,它就可以工作。例如,以下工作。为什么以上不起作用?我认为这是 Odata 限制。

http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($select=Emails)

http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($top=1)

【问题讨论】:

    标签: asp.net-web-api odata


    【解决方案1】:

    在扩展中,您需要使用分号来分隔不同的选项,而不是与号。这个 URL 应该可以工作:

    http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($select=Emails;$top=1;$skip=1)
    

    【讨论】:

    • OData V2 是否有等效的方法来使用 $skip 和 $top 来进行 $expand?
    猜你喜欢
    • 2021-09-20
    • 1970-01-01
    • 1970-01-01
    • 2019-10-08
    • 1970-01-01
    • 2015-04-24
    • 2017-02-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多