This project is read-only.


As a continuation of my previous blog post, we created a live AdventureWorks OData feed at The AdventureWorks OData service exposes resources based on specific SQL views. The SQL views are a limited subset of the AdventureWorks database that results in several consuming scenarios:

  • CompanySales
  • Documents
  • ManufacturingInstructions
  • ProductCatalog
  • TerritorySalesDrilldown
  • WorkOrderRouting

We will be iterating on this sample, so expect it to improve over time. For instance, the Documents feed currently exposes the document entity type property as an Edm.Binary type. An upcoming iteration will show how to implement Named Resource Streams for the Documents.Document entity type property.

User Story

This sample iteration addresses the following user story:

As a backend developer, I want to only allow views of the AdventureWorks2012 database to be exposed as an OData public resource so that the underlying schema can be modified without affecting the service.

Source Download

Install the sample

You can consume the AdventureWorks OData feed from You can also consume the AdventureWorks OData feed by running the sample service from a local ASP.NET Development Server.

To run the service on a local ASP.NET Development Server

  1. Download the sample from this blog or {CodePlex}.
  2. Attach the AdventureWorks2012 database. The AdventureWorks2012 database can be downloaded from
  3. From Microsoft SQL Server Management Studio, run \AdventureWorks.OData.Service\SQL Scripts\Views.sql to create the OData feed SQL views.
  4. Open \AdventureWorks.OData.Service\AdventureWorks.OData.Service.sln in Visual Studio 2012.
  5. In Solution Explorer, select AdventureWorks.svc.
  6. Press F5 to run the service on http://localhost:1234/AdventureWorks.svc/.

Last edited Sep 6, 2012 at 1:38 AM by DerrickVMSFT, version 1


No comments yet.