简体   繁体   English

WebAPI OData包含相关实体,而无需使用$ expand选项

[英]WebAPI OData include related entities without using $expand option

Expanding upon this earlier question 扩展之前的问题

From the documentation here , it states: 此处的文档中,它指出:

"When you query an OData entity or collection, the default response does not include related entities." “查询OData实体或集合时,默认响应不包括相关实体。”

Is there any way to include related entities without using the $expand option? 没有不用 $ expand选项就可以包含相关实体的方法?

No, there is no way to contain the related entities without using the $expand. 不,如果不使用$ expand,就无法包含相关实体。 But if you only want the related ones, you can use navigation property such as: ~/Categories(1)/Products 但是,如果只需要相关的内容,则可以使用导航属性,例如:〜/ Categories(1)/ Products

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM