Odata网址转换(降序排列) [英] Odata Url conversion with descending orderby

查看:101
本文介绍了Odata网址转换(降序排列)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过按患者的Visidate降序来获取数据,所以我尝试了这样的网址

i need to get data by descending orderby Visidate of patient so i tried url like this

192.168.1.105:33396/FalconCPDataService.svc/DEPhysicians?$format=json&$expand=DEPatientVisits&$orderby=DEPatientVisits/VisitDate+desc

但显示异常

{"odata.error":{"code":","message":{"lang":"en-US","value":属性'VisitDate的属性访问的父值'不是单个值.属性访问只能应用于单个值.}}}

{"odata.error":{"code":"","message":{"lang":"en-US","value":"The parent value for a property access of a property 'VisitDate' is not a single value. Property access can only be applied to a single value."}}}

推荐答案

原因是DEPatientVisits不是单值导航属性,因此无法向其添加属性名称.如果它是单个值,则可以正常工作,例如:

The reason is that DEPatientVisits is not a single valued navigation property, so it is unable to append a property name to it. If it is a single valued, it works fine, such as:

http://services.odata.org/v4/OData/OData.svc/Products?$expand=Supplier&$orderby=Supplier/Name

这篇关于Odata网址转换(降序排列)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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