问题描述
我正在OData中编写这样的DateTime过滤器查询:
I am writing an DateTime filter query in OData like this:
... + "$filter=SubmitTime lt datetime'2014-12-30T23:59:59.99Z'"
并遇到以下错误:
我确实遵循了OData格式指南和其他在线参考,并且我编写的字符串与该指南保持一致.
I did follow the OData format guideline and other online references, and the string I wrote is aligned with the guideline.
这是由dll版本引起的问题吗?如这篇文章中所述: WebAPI OData DateTime错误
So is this a problem caused by dll version? like stated in this post:WebAPI OData DateTime error
我正在使用的Microsoft.OData.Edm.dll版本是:运行时版本:v4.0.30319版本:6.3.0.0
The Microsoft.OData.Edm.dll version I am using is:Runtime Version: v4.0.30319Version: 6.3.0.0
有什么想法吗?谢谢!
推荐答案
似乎您正在使用实现OData V4的OData库.在OData V4规范中,不存在DateTime基本类型,只有DateTimeOffset.
It seems that you are using the OData library which implement OData V4.In OData V4 spec, no DateTime primitive type exist, only have DateTimeOffset.
您可以尝试使用以下网址吗:
Could you try the URL:
...?$filter=SubmitTime lt 2014-12-30T23:59:59.99Z
这篇关于OData DateTime过滤器Edm.String错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!