The. NET Framework WebAPI,. NET Core WebAPI uses swagger précis-writers

Source: Internet
Author: User

Recently has been very confused, do not know what to learn, but there are too many things need to learn (I am still a small white, do not know the vast number of small white whether I have such trouble), so first to use the things and. Net core to do the contrast, no more than do not know, a better than the whole of his own, Next look at the pit I stepped on ...

The. Net framework use of WEBAPI is still relatively straightforward, and has been known for some time about the use of swagger in the Framework API to smooth through the meadows ...

First: Download a swagger on NuGet, as follows:

  

After the download is complete, the SwaggerConfig.cs file will appear in your App_start directory,

That's right.... That's it.. What's the use of him? I don't know... Look down.

Second:swaggerconfig files are basically comments, delete deleted ... At last it became like this.

  

Solution Properties---> Build---> Tick the XML document file

    

Now you know where the last picture came from ..... Net framework this piece is so simple. The next step is. Net Core.

. Net Core Wwebapi

The first time I downloaded one from NuGet, I didn't know why I couldn't. I compare dishes ...

Then use the online introduction of the method to download a ... Input: Install-package swashbuckle.aspnetcore-pre good.

Follow the tutorial steps to finally have a problem. What's the problem?? I do not know what the problem, maybe I downloaded the swagger two times there is a conflict it. Rage re-built a webapi, follow the on-line tutorial steps to success. Specifically I will not say, the online tutorial is very detailed. Next I'll talk about the steps to send the diagram.

1: Inject swagger service

2: Configure usage Properties

3: Modify the address at startup in the picture's directory

4: According to the image of the way you can modify

Write rough, mainly for the convenience of making a record. Swagger is still very strong, if the writing is not good please forgive me.

The. NET Framework WebAPI,. NET Core WebAPI uses swagger précis-writers

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.