Reputation: 199
I was looking into reflection provider of Odata and I understand that the queries that client request will be filtered in the list(CLR object) we expose as IQuereable element.Is there any way in which we can capture the query request URL-at server side and parse the URL so that we can populate the list we expose, with relevant information on demand instead of populating with whole dump of data?
Upvotes: 0
Views: 749
Reputation: 13320
The designed way to do this is to actually implement the IQueryable. It can be a bit complex, but it gives you all the information you need without the necessity parse the URL (which is even more complex to get it right).
Take a look at this series of blogs which describe the expressions trees you may encounter: http://blogs.msdn.com/b/vitek/archive/2010/02/25/data-services-expressions-part-1-intro.aspx
And then probably this one, which shows that you can process only parts of the expression tree and evaluate the rest in-memory just like you do today: http://blogs.msdn.com/b/vitek/archive/2012/01/07/projections-in-custom-providers-simple-solution.aspx
I know of several OData server implementations which use this approach of partially implementing the IQueryable (mostly the filtering and sorting is done in the backend, and the rest is done in-memory).
Upvotes: 1