Fix snippets in NSwag tutorial (#8656)

Fixes the used snippets in the NSwag tutorial (currently the imports are missing and the configure snippet is used twice).
pull/8780/head
Rico Suter 2018-09-21 19:16:54 +02:00 committed by Scott Addie
parent a485e606d2
commit 2e19966947
1 changed files with 2 additions and 2 deletions

View File

@ -91,11 +91,11 @@ dotnet add TodoApi.csproj package NSwag.AspNetCore
Import the following namespaces in the `Startup` class:
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_ConfigureServices&highlight=8-8)]
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_StartupConfigureImports)]
In the `Startup.ConfigureServices` method, register the required Swagger services:
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_Configure&highlight=6-10)]
[!code-csharp[](../tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.NSwag/Startup.cs?name=snippet_ConfigureServices&highlight=8)]
In the `Startup.Configure` method, enable the middleware for serving the generated Swagger specification and the Swagger UI v3: