I have been a fan of ADO.NET Data Services (Astoria) for a long time. Last week at the PDC, Microsoft unveiled the new name for ADO. NET Data Services: WCF Data Services. That makes sense since Astoria was built on top of WCF, not ADO .NET. I thought that Astoria was a cool code name and that ADO.NET Data Services sucked as a product name. At least WCF Data Services sucks less since at least it is more accurate and reflects the alignment of WCF, REST capabilities of WCF, and RIA Services (now WCF Data Services).
Astoria, I mean WCF Data Services :), is a way to build RESTful services very easily on the Microsoft platform. Astoria implements extensions to ATOMPub and uses either ATOM or JSON to publish its data. The protocol that Astoria used did not have a name. Since other technology was using this Astoria protocol inside (and even outside of) Microsoft, Microsoft decided to give it a name and place the specification under the Open Specification Promise. Astoria’s protocol is now called: the Open Data Protocol, or OData.
If you have been using Astoria and liked it, not much is different. What is cool is that other technology is now adopting OData including: SharePoint 2010, SQL Server 2008 R2, PowerPivot, Windows Azure Table Storage, and 3rd party products like IBM’s WebSphere eXtreme Scale.
With all of this technology supporting OData, Microsoft created the Open Data Protocol Data Visualizer for Visual Studio 2010 Beta 2. The tool gives you the ability to connect to a service and graphically browse the shape of the data. You can download it from here or search the extensions gallery for Open Data. Once you have it installed you can view OData data very easily. Here is how.
To get started you first have to create a WCF Web Data Service. I just mapped Northwind to an Entity Data Model using the Entity Framework and then created the WCF Data Service. Then I added a console application and set a service reference back to that Astoria Service. My projects looks like this:
To start the OData Protocol Data Visualizer, just right click on the Service Reference and click “View in Diagram.” This “View in Diagram” menu option will show up when you have a Service Reference that is OData compatible, whether you created it or not. (Meaning if you have a Sharepoint list as your service reference, it will work as well.)
This brings up the diagram canvas and corresponding OData Protocol Model Browser.
From here you can select an entity from the Model Browser and drag it onto the canvas. I dragged over the Customer entity and right clicked and was able to add all related entities.
From here you can interrogate your model and start to learn about it, all in Visual Studio. This is a great little add-in!