Getting Started with Web API
ASP.NET MVC 4 ships as part of Visual Studio 2012 and as an add-on for Visual Studio 2010 SP1. The installer includes all of the components of ASP.NET Web API.
All the MVC project templates include the necessary binaries and configuration to support both MVC and Web API code; they only differ in what sample files are placed into the project by default. The template labeled “Web API,” as shown in Figure 11.1, is the only one that includes a sample API controller. Controllers of both types — MVC and Web API — can be added to existing projects through both the File &cmdarr; New Item menu in Visual Studio and the Add &cmdarr; Controller context menu item inside Solution Explorer. This includes generating controllers with Entity Framework database access code for all read and write operations.
Get Professional ASP.NET MVC 4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.