raghuramn wrote:
Right, Queryable is strongly typed and unfortunately there is no public extension point to override it. Could you please let me know the scenario that you are trying to make work so that I can suggest a workaround if any instead ?
Hey Raghuramn, thanks for the swift reply.
What I'm trying to do is expose some product data in xml/json that's easy to filter by anyone. (mostly using jQuery) The problem is that not all of my products are of the same type. I'm required to permit a query such as:
/API/Products?$filter=ShoeSize eq 10, returning only products of the types that have a ShoeSize property. I've made this work already using a custom IQueryable. Web API just wont allow me to call it because the base type doesn't have the properties
I query for.
I've also thought about parsing the OData filter manually and build the results based on that, but that seems both time consuming and error prone. 3rd parties are supposed to be consuming the service and experience taught me that rolling your own solution
or deviating from the standard will come back to haunt you :)
|