Does anyone know if there an open-source .NET wrapper that can reliably parse the OData protocol Uri?
I'm not looking for pointers to WCF Data Services... I'm creating a WCF-based data querying service that (for complicated reasons) cannot be a real Atom/OData service, but I really like the expressiveness of the OData Uri for identifying a datasource and query parameters. Plus we may expose an OData endpoint some time in the future.
I've looked (cursorally) through the WCF Data Service API and there does not seem to be a neatly wrapped-up ODataUri class that exposes service host, resource path and query parameters. I can write one, but before I do I'd rather see if someone has done it already.
OData is a protocol to access data created by Microsoft. It provides CRUD operations and is similar to JDBC or ODBC but not limited to databases. OData uses protocols ATOM and JSON and the requests use a REST model. For this reason, OData is an implementation of the RESTful API that describes the data and their model.
The Open Data Protocol (OData) enables the creation of REST-based data services, which allow resources, identified using Uniform Resource Identifiers (URIs) and defined in a data model, to be published and edited by Web clients using simple HTTP messages.
The OData Protocol is an application-level protocol for interacting with data via RESTful interfaces. It supports the description of data models, editing and querying of data according to those models.
In computing, Open Data Protocol (OData) is an open protocol that allows the creation and consumption of queryable and interoperable REST APIs in a simple and standard way. Microsoft initiated OData in 2007. Versions 1.0, 2.0, and 3.0 are released under the Microsoft Open Specification Promise.
I know you said you looked at the API, but have you looked at the actual code. The .Net Client Library has been opened sourced, http://odata.codeplex.com/ so if you can't find one out there, you can use their code as a starting point (and hopefully contribute it back to the community).
Essentially, what you need is a LINQ to OData Uri provider. If I remember correctly, one of the nick-names for Astoria was LINQ to REST. What you have to do is on the client side, convert a LINQ expression tree to the OData URI format, and on the server, convert the URI back to a LINQ Expression tree. Creating custom LINQ providers isn't the easiest thing to do, but Matt Warren has a great (long) series on building IQueryable Providers http://blogs.msdn.com/b/mattwar/archive/2008/11/18/linq-links.aspx
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