我需要將我的OData服務更新到第三個版本。現在,我只使用NuGet存儲庫中的新庫和DataServiceConfiguration集屬性MaxProtocolVersion中的舊版庫更改爲V3。
可能這是不夠的?有人知道,爲了支持我的應用程序中的任何/所有過濾器,我必須做些什麼?如何使用任何/所有過濾器創建OData v3服務
當我嘗試發送的請求是這樣的:
http://expamle.com/OData.svc/Contacts $濾芯的電話/否?(P:P /數EQ '111-222-333-11')
我的應用程序拋出這個異常:
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>4</code>
<message xml:lang="" />
<innererror>
<message>No property 'any' exists in type 'City' at position 5.</message>
<type>System.Data.Services.DataServiceException</type>
<stacktrace>
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseMemberAccess(Expression instance)
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParsePrimary()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseUnary()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseMultiplicative()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseAdditive()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseComparison()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseLogicalAnd()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseLogicalOr()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseExpression()
at System.Data.Services.Parsing.RequestQueryParser.ExpressionParser.ParseWhere()
at System.Data.Services.Parsing.RequestQueryParser.ParseLambdaForWhere(IDataService service, RequestDescription requestDescription, Type queryElementType, String expression)
at System.Data.Services.Parsing.RequestQueryParser.Where(IDataService service, RequestDescription requestDescription, Expression source, String predicate)
at System.Data.Services.RequestQueryProcessor.ProcessFilter() at System.Data.Services.RequestQueryProcessor.ProcessQuery()
at System.Data.Services.RequestQueryProcessor.ProcessQuery(IDataService service, RequestDescription description)
at System.Data.Services.RequestUriProcessor.ProcessRequestUri(Uri absoluteRequestUri, IDataService service, Boolean internalQuery)
at System.Data.Services.DataService`1.ProcessIncomingRequestUri()
at System.Data.Services.DataService`1.HandleRequest()
</stacktrace>
</innererror>
</error>
謝謝,您的建議是正確的 – 2012-08-20 09:53:45