Microsoft provides a WCF Data Services Client Library to implement OData clients in C#. This library works on the principle of creating a typed reference to the OData service.
What would be a good approach to implement an OData client in C# without having to previously generate a typed service interface? In other words, what would be a good way to implement an OData client in C# that could work with several different OData services, given the base URL and entity names as strings?
Such client would use dynamic C# objects or dictionaries to represent the entities, instead of typed entity objects.
Which existing libraries or projects could be leveraged to implement this?
One application of this technique would be to develop a generic functional test suite helper library that could be used to implement tests of OData services.
The pointer to odata-sdk above is definitely a good start. For one the OData Explorer which is also listed on that site is almost exactly what you're looking for. It's a general OData service "browser".
Another approach (maybe even better) would be to use Microsoft.Data.OData.dll. It's part of the latest CTP of WCF Data Services (http://blogs.msdn.com/b/astoriateam/archive/2011/10/13/announcing-wcf-data-services-oct-2011-ctp-for-net-4-and-silverlight-4.aspx). It's a low-level reader and writer for OData. It doesn't solve the URL processing, but reading and writing the payloads works great. There's a sample of a usage here: http://blogs.msdn.com/b/astoriateam/archive/2011/10/14/introducing-the-odata-library.aspx
you need nothing more than a URL/ String Parser for this , for more drill down approach you may also like to look at some options here:
http://www.odata.org/developers/odata-sdk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With