从 odata 响应中删除 __metadata 标记
我想从 odata 查询的响应中删除 __metadata 标签。我知道你可以使用 $select 来指定你想要的字段,但我似乎无法摆脱 __metadata。这将使我的查询压缩约 50% 到 75%。
关于如何删除 __metadata 标签有什么想法吗?
I'd like to remove the __metadata tag from responses in my odata queries. I know you can use $select to specify what fields you want, but I can't seem to get rid of __metadata. This would compact my queries by about 50 to 75%.
Any ideas on how you can remove the __metadata tag?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题已经讨论过:WCF数据服务:如何避免 __metadata 成员
简而言之,WCF 数据服务产品目前不支持此功能。主要原因是,返回的数据不再符合 OData,并且可能使客户端无法执行某些类型的操作。
This has already been discussed in this question: WCF Data Services: How to avoid the __metadata members
In short the WCF Data Services product doesn't support this currently. The main reason is, that the returned data is not OData compliant anymore as well as it might make it impossible for clients to perform certain types of operations.