How do I perform projection on expanded entities in OData?
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)
精彩评论