Web API Series two WEBAPI basic framework construction

Source: Internet
Author: User

This article mainly describes how to build a WEBAPI project. There are two ways to build a webapi:

First, create a new WEBAPI project directly with VS, the following steps:

The first step:

Create a new empty Web application that can be understood as a host of Webapi

Click OK

Step Two:

Click OK to create the success!

This completes a WEBAPI project creation, VS will help us to import the relevant assemblies and packages, for short, fool-like installation, haha!

Second, starting from 0 installation

The first step:

Click OK!

Step Two:

Click OK to complete an empty Web application build

Then manually add a reference to the relevant WEBAPI!

Step three: Add dependent assemblies and packages

There are two ways to add dependent dependencies for Webapi:

(1), simplest and most straightforward, add Webapi dependencies by "Manage NuGet packages"

Click Install, I have installed here, so there is no installation option.

Open the Packages.config file below the project as follows

OK, indicating WEBAPI installation is successful

(2), through the Package Manager console to add Webapi dependent

OK, add success, open the Packages.config file below the project as follows

OK, the same installation is successful

Third, the first type of fool and the second starting from 0 to build WEBAPI project Scaffolding differences

By observing both of the Packages.config files found, in fact, there is still a difference between the two, such as:

Fool-style building Webapi project more than the above red box of several packages, a class is the corresponding Chinese package (Zh-hans), the other is a help page, of course, you can not need, these additional packages, is Microsoft to help us improve the efficiency of development use, of course, if you need, You can add it yourself through the NuGet Package Manager.

OK, so far, the simple WEBAPI project scaffolding is completed, all the dependencies are as follows:

Web API Series two WEBAPI basic framework construction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.