“orderby”上的数据URL转换错误

本文关键字:URL 转换 错误 数据 orderby | 更新日期: 2023-09-27 18:09:57

我需要按顺序显示数据

我有这样的url,需要显示基于日期的数据

我试过了

http://localhost:33396/values.svc/Names?$format=json&$expand=Address&$select=Address/PhoneNumber,Address/Pincode&$filter=Address/any(value:value/Pincode+eq+guid%27600045%27)+and+Address/any(value:value/country+eq+guid%27India%27)%20&$orderby=Address/Date+desc

但是我得到这样的错误

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

如何解决这个问题

“orderby”上的数据URL转换错误

Address是Names的导航属性,对吗?从错误显示来看,我认为Address是一个集合。属性访问只能用于单个值,否则会混淆使用哪个项来获取"Address"集合中的指定属性"Date"。