I am working on a generic OData provider to go against a custom data provider that we have here. Thsi is fully dynamic in that I query the data provider for the table it knows. I have a basic storage structure in place so far based on the OData sample code.
My problem is: OData supports queries and expects me to hand in an IQueryable implementation. On the lowe rside, I dont have any query support. Not a joke - the provider returns tables and the WHERE clause is not supported. Performance is not an issue here - the tables are small. It is ok to sort them in the OData provider.
My main problem is this.
- I submit a SQL statement to get out the data of a table. The result is some sort of ADO.NET data reader here.
- I need to expose an IQueryable implementation for this data to potentially allow later filtering.
Any ide ahow to best touch that? .NET 3.5 only (no 4.0 planned for some time). I was seriously thinking of creating dynamic DTO classes for every table (emitting bytecode) so I can use standard LINQ. Right now I am using a dictionary per entry (not too efficient) but I see no real way to filter / sort based on them.
Pablo Castro, one of the main voices behind OData says that delivering an OData service without the querying capability is completely within consistent within their intent. See this blog post.
This is one of the reasons I really wish they would implement a "search" link in the OData response so that a client application could determine if querying capabilities were available or not. Something like OpenSearch.
That way, a client can easily discover if search is implemented or not.