WebAPI OData包括没有使用$ expand选项的相关实体 [英] WebAPI OData include related entities without using $expand option

查看:122
本文介绍了WebAPI OData包括没有使用$ expand选项的相关实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开此前的问题

从文档这里,它指出:

当您查询OData实体或集合,默认响应不包括相关实体。

"When you query an OData entity or collection, the default response does not include related entities."

有没有办法使用$ expand选项包含相关实体而不使用

Is there any way to include related entities without using the $expand option?

推荐答案

不,没有办法在不使用$ expand的情况下包含相关实体。但是如果你只想要相关的,可以使用导航属性,例如:
〜/ Categories(1)/ Products

No, there is no way to contain the related entities without using the $expand. But if you only want the related ones, you can use navigation property such as: ~/Categories(1)/Products

这篇关于WebAPI OData包括没有使用$ expand选项的相关实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆