locked
Is there a way to save the results of an ODataReader in an object to then access multiple times? RRS feed

  • Question

  • I just need the entries (including complex ones at any level of nesting). Is there a way to do that in the OData library or do I need to save this off myself?

    The purpose is our library allows them in the template to set a query at one point and then later access the results of the query. So there could then be 20 different times those results are accessed.

    ??? - thanks - dave


    Who will win The International Collegiate Programming Championships?

    Tuesday, August 7, 2012 11:07 PM

Answers

  • Hi,

    We don't have that mechanism in ODataLib. But the instances returned by the reader are "standalone", so you can store them in your own lists (or whatever) as much as you want.

    We implemented a caching layer internally for testing purposes and honestly it's pretty easy (you just store all entries in a feed in a list and then handle expanded navigation links appropriately as well). You can use the annotation mechanism on ODataEntry/ODataFeed/ODataNavigationLink to even store these on the entry itself, so that you don't have to wrap them in your own classes. And then just have extension methods to make the access easier.

    We do have plans to make the caching layer public as a sample, we just didn't get to it yet.

    Thanks,


    Vitek Karas [MSFT]

    Wednesday, August 8, 2012 10:19 AM
    Moderator