OData and case sensitivity

2019-06-19 18:46发布

问题:

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 make it case insensitive?

回答1:

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



回答2:

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