Skip to content

Commit 9cffead

Browse files
authored
Min Web API: Remove using statement update content & code (#33200)
* Min Web API: Remove using statement update content * Applying to v7 content and code * Update v7 code highlights
1 parent 5acba08 commit 9cffead

File tree

8 files changed

+4
-24
lines changed

8 files changed

+4
-24
lines changed

aspnetcore/tutorials/min-web-api.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Tutorial: Create a minimal API with ASP.NET Core"
33
author: wadepickett
44
description: Learn how to build a minimal API with ASP.NET Core.
55
ms.author: wpickett
6-
ms.date: 06/27/2024
6+
ms.date: 07/29/2024
77
ms.custom: engagement-fy24
88
monikerRange: '>= aspnetcore-6.0'
99
uid: tutorials/min-web-api
@@ -206,13 +206,9 @@ The previous command adds the [NSwag.AspNetCore](https://www.nuget.org/packages/
206206

207207
### Configure Swagger middleware
208208

209-
* In Program.cs add the following `using` statements at the top:
209+
* In Program.cs add the following highlighted code before `app` is defined in line `var app = builder.Build();`
210210

211-
[!code-csharp[](~/tutorials/min-web-api/samples/9.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_using_statements)]
212-
213-
* Add the following highlighted code before `app` is defined in line `var app = builder.Build();`
214-
215-
[!code-csharp[](~/tutorials/min-web-api/samples/9.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_add_service&highlight=8-14)]
211+
[!code-csharp[](~/tutorials/min-web-api/samples/9.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_add_service&highlight=7-13)]
216212

217213
In the previous code:
218214

aspnetcore/tutorials/min-web-api/includes/min-web-api6-7.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,9 @@ The previous command adds the [NSwag.AspNetCore](https://www.nuget.org/packages/
172172

173173
### Configure Swagger middleware
174174

175-
* In Program.cs add the following `using` statements at the top:
176-
177-
[!code-csharp[](~/tutorials/min-web-api/samples/7.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_using_statements)]
178-
179175
* Add the following highlighted code before `app` is defined in line `var app = builder.Build();`
180176

181-
[!code-csharp[](~/tutorials/min-web-api/samples/7.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_add_service&highlight=8-14)]
177+
[!code-csharp[](~/tutorials/min-web-api/samples/7.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_add_service&highlight=7-13)]
182178

183179
In the previous code:
184180

aspnetcore/tutorials/min-web-api/includes/min-web-api8.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,6 @@ The previous command adds the [NSwag.AspNetCore](https://www.nuget.org/packages/
187187

188188
### Configure Swagger middleware
189189

190-
* In Program.cs add the following `using` statements at the top:
191-
192-
[!code-csharp[](~/tutorials/min-web-api/samples/8.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_using_statements)]
193-
194190
* Add the following highlighted code before `app` is defined in line `var app = builder.Build();`
195191

196192
[!code-csharp[](~/tutorials/min-web-api/samples/8.x/todo_SwaggerVersion/Program.cs?name=snippet_swagger_add_service&highlight=8-14)]

aspnetcore/tutorials/min-web-api/samples/7.x/todo_SwaggerVersion/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// <snippet_all>
1313
// <snippet_swagger_add_service>
1414
// <snippet_swagger_using_statements>
15-
using NSwag.AspNetCore;
16-
// </snippet_swagger_using_statements>
1715
using Microsoft.EntityFrameworkCore;
1816

1917
var builder = WebApplication.CreateBuilder(args);

aspnetcore/tutorials/min-web-api/samples/9.x/todoDTO_SwaggerVersion/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// <snippet_all>
2-
using NSwag.AspNetCore;
32
using Microsoft.EntityFrameworkCore;
43

54
var builder = WebApplication.CreateBuilder(args);

aspnetcore/tutorials/min-web-api/samples/9.x/todoGroup_SwaggerVersion/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// <snippet_all>
2-
using NSwag.AspNetCore;
32
using Microsoft.EntityFrameworkCore;
43

54
var builder = WebApplication.CreateBuilder(args);

aspnetcore/tutorials/min-web-api/samples/9.x/todoTypedResults_SwaggerVersion/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// <snippet_all>
2-
using NSwag.AspNetCore;
32
using Microsoft.EntityFrameworkCore;
43

54
var builder = WebApplication.CreateBuilder(args);

aspnetcore/tutorials/min-web-api/samples/9.x/todo_SwaggerVersion/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#elif FINAL
1212
// <snippet_all>
1313
// <snippet_swagger_add_service>
14-
// <snippet_swagger_using_statements>
15-
using NSwag.AspNetCore;
16-
// </snippet_swagger_using_statements>
1714
using Microsoft.EntityFrameworkCore;
1815

1916
var builder = WebApplication.CreateBuilder(args);

0 commit comments

Comments
 (0)