Software Environment
VS Update3
This section explains how to create a Web API project by using an example
The first step, open vs, through the File menu, the new Project command, the approximate steps such as:
2nd, in the pop-up dialog, select the Web under the C # template on the left, and then choose the first selection based on the traditional Framework4.5.2, roughly as follows:
The 3rd step, based on the previous step, selects the WebAPI template, which automatically references the core references of MVC and WebAPI, roughly as follows:
After successful creation, the approximate directory structure is as follows:
The above directory structure is very similar to the MVC organizational structure,
App_start: Once the routing configuration is initialized,
areas: Module folder, note defining each module.
Content:CSS style files are already picture resource files.
fonts: defines a font resource
Controllers: controller.
Models: Business Entities
Views: View Page
Scripts: JavaScript files
Results: The Ihttpactionresult interface has been encapsulated with a common logic Httpresponsemessage implementation Class (later chapters will be described, see the Web API Operation return result type section for details)
Here we generate a complete API project, which runs directly by F5 and generates a WPI help page as follows:
In this section, you'll end up with a template for building a Web API project. Introduction to the directory structure
If you do not understand, please refer to the following documents:
Getting Started with Web APIs
Create the first Web API project using a template