.NET Core API with Swagger

Creating the API using Visual Studio 2019

First, choose the ASP.NET Core Web Application template.

Installing the NuGet packages

Adding the lines of code

Next, add these lines of codes to your Startup.cs file.

Testing

If you followed the steps nicely the swagger will be running.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store