Odata endpoint returning 404 bad request when the "$" in filter is encoded

628 Views Asked by At

I have an Azure Mobile service with a .Net back end.

In the backend the data object use proper case. for example, MemberNumber. In the azure client the view models use pascal case memberNumber.

I am using a library that creates an ODATA request and I get: The query specified in the URI is not valid. Could not find a property named 'memberNumber' on type 'arenaapi.DataObjects.Members'.

That happens with this get: /tables/members?%24inlinecount=allpages&%24orderby=memberNumber

If I change that the MemberNumber it works. However, also, if I change the request to:

/tables/members?%24inlinecount=allpages&$orderby=memberNumber

It also works. It seems that the model binding parser is working differently if the $ is encoded or not.

Is there any way I can fix this server side so the encoded request won't return a 400 without changing the memberNumber to MemberNumber?

All the other stuff, posting, patching, etc is properly binding the pascal cased JSON post to proper cased c# data objects.

0

There are 0 best solutions below