Skip to Main Content
ASP.NET Core MVC 2.0 Cookbook
book

ASP.NET Core MVC 2.0 Cookbook

by Jason De Oliveira, Engin Polat, Stephane Belkheraz
February 2018
Intermediate to advanced content levelIntermediate to advanced
668 pages
15h 18m
English
Packt Publishing
Content preview from ASP.NET Core MVC 2.0 Cookbook

How to do it...

  1. First, let's add the Swashbuckle reference to the project:
"Swashbuckle": "5.6.0"
  1. Next, let's add Swagger as a middleware in Startup.cs:
public void ConfigureServices(IServiceCollection services){  services.AddMVC();  services.AddSwaggerGen();}public void Configure(IApplicationBuilder app){  app.UseMVC();  app.UseSwagger();  app.UseSwaggerUi();}
  1. Now, let's launch our API documentation by going to http://{UrlAPI}/swagger/ui. We can now see the generated API documentation:
  1. When we click on each HTTP method, we can see all the options Swagger offers to us, such as testing the API, easily:
  1. Next, let's use another feature: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Core and Vue.js

ASP.NET Core and Vue.js

Devlin Basilan Duldulao
Mastering ASP.NET Web API

Mastering ASP.NET Web API

Mithun Pattankar, Malendra Hurbuns

Publisher Resources

ISBN: 9781785886751Other