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