Among other things, I've been involved in aligning ADO.NET Data Services and .NET Ria Services. While this effort is still in its early stages, there are a couple of new scenarios available today. One of them is accessing Azure services from a .NET Ria Services client.
For this example, I'm going to use the Open Government Data Initiative's Azure service. They have a bunch of interesting data that you may want to include in your application. Note that this is reference data only. In a follow-up post I may share an example of submitting changes to Azure services.
The first step is to generate code for all the entities and the service object. OGDI has a T4-based code generator that generates code for an ADO.NET Data Services client. I decided to take that code and tweak it such that it generates code we can use with .NET Ria Services. In a nutshell, we need to generate the following:
Once we've got this code, we're good to go. To let our DomainContext speak Azure's protocol (AtomPub with some extensions), we need to use the new AtomDomainClient, which lives in System.Windows.Ria.Atom.dll. (The "Atom" name will go away in a future release.) I tweaked the code generator such that our DomainContext directly instantiates an AtomDomainClient passing in the correct URL.
To test this, we can create a Silverlight app, reference the class library which generates our code using T4, and then do what you would normally do with .NET Ria Services. (For example, set up a DomainDataSource and bind it to a DataGrid.)
The same approach applies to any other ADO.NET Data Services based service. In a follow-up post I may share a basic code generator that generates code based on ADO.NET Data Services' CSDL ($metadata).
Check out the code and binaries that go with this post to run the demo and see how it works.