December 2018
Beginner to intermediate
668 pages
15h 30m
English
Open Startup.cs, and import the Swashbuckle's Swagger namespace, as shown in the following code:
using Swashbuckle.AspNetCore.Swagger;
In the ConfigureServices method, add a statement to add Swagger support with documentation for the Northwind service, as shown in the following code:
// Register the Swagger generator, and define a Swagger document //for Northwind serviceservices.AddSwaggerGen(c =>{ c.SwaggerDoc("v1", new Info { Title = "Northwind Service API", Version = "v1" });});
In the Configure method, add a statement to use Swagger and Swagger UI, and define an endpoint for the OpenAPI specification JSON document, as shown in the following code:
app.UseSwagger();app.UseSwaggerUI(c =>
Read now
Unlock full access