使用odata选择不同的值 [英] Select distinct values with odata

查看:62
本文介绍了使用odata选择不同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建对odata Web服务的调用,该调用将仅选择某些属性的不同值.有什么很好的例子吗?

I'm trying to create a call to odata webservice that would select only distinct values of some property. Is there any good example of how to do this?

推荐答案

当前,OData协议不支持distinct运算符,或任何其他有助于此类查询的运算符(假设您正在寻找a的不同值)某个实体的原始属性). 您应该能够通过在服务器上实现服务操作来解决此问题,该服务操作通常对具有该功能的基础提供程序执行这种查询.然后客户端可以调用该服务操作.

Currently the OData protocol doesn't support the distinct operator, or any other operator which would help with such query (assuming you're looking for disctinct values of a primitive property on some entity). You should be able to workaround this by implementing a service operation on the server which performs such query on the underlying provider which usually has that ability. And then the client can call that service operation instead.

这篇关于使用odata选择不同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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