开发者

How do I perform projection on expanded entities in OData?

开发者 https://www.devze.com 2023-02-05 08:18 出处:网络
When I execute the following O开发者_开发百科Data query I see a particular Netflix title with its awards expanded.

When I execute the following O开发者_开发百科Data query I see a particular Netflix title with its awards expanded.

http://odata.netflix.com/Catalog/Titles?$filter=Name eq 'The Name of The Rose'&$expand=Awards&$select=Rating,Awards

Note that I have projected just the Rating property of the title.

Can I also project ($select) specific properties of the expanded awards? That is, for each Award in the expansion, show me only the Category and Year properties.


Sure, just modify the query to include:

$select=Rating,Awards/Category,Awards/Year


Here is the example is using Asp.Net Odata with top, filter, select and select expanded property

http://test.com/odata/Entity/?$top=20&$filter=contains(Name,'A')&$select=Name,Email&$expand=Child($select=ChildPropertyName)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号