开发者

OData and case sensitivity

开发者 https://www.devze.com 2023-01-25 09:45 出处:网络
I\'ve been messing with the OData and realized that URIs are case sensitive. .../Northwind.svc/Products != .../Northwind.svc/products

I've been messing with the OData and realized that URIs are case sensitive. .../Northwind.svc/Products != .../Northwind.svc/products Is this done on purpose? is there a way to ma开发者_Go百科ke it case insensitive?


The recommended solution is to either use the supported OData functions toupper or tolower to work out the case sensitivity issues (when using a filter$ command) and get the full result set.

I wrote a brief post explaining this a bit further in detail:
Dealing With Case Sensitivity in OData


Here's an example:

/people?$filter=tolower(Name) eq tolower('jAmes') - 

This would return you all people with name is 'James' (case insensitive, could be 'JAMES', 'james', 'JamES', etc.
Hope this will help

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号