Tuesday, April 2, 2013

ASP.NET oData tutorial with Web API

Microsoft finally realizes it needs to provide some clean and simple functions to support developers, instead of leaving everything in developer's hands. To see a sample of this, just opening the IIS manager, the 40+ icons will make you feel you need to be a pilot in order to drive a car.
Web API is in the right direction to make things simple, and hope it can keep what it promised. The following are some steps for me to make the ASP.NET Web API oData tutorial work.
1. Install Visual Studio 2012 profiession.
2. Apply Visual Studio update 1
3. Apply Web Tool for Visual Studio 2012.2
4. Get Microsoft ASP.NET Web API OData NuGet package by console command (Why no a GUI tool, is console back in fashion?): "Install-Package Microsoft.AspNet.WebApi.OData"
5 In ProductsController.cs add using System.Web.Http.OData;
6. In WebApiConfig.cs, add using System.Web.Http.OData.Builder;
Now you should be able to build the project. From browser, navigate to the following link to show the sample data.
http://localhost:58478/oData/Products


No comments:

Post a Comment