Skip to content

Commit ea910aa

Browse files
committed
Light Freshness Edit: ASP.NET - migration & tutorials
1 parent b4c712c commit ea910aa

4 files changed

Lines changed: 28 additions & 27 deletions

File tree

aspnetcore/migration/80-to-90.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Migrate from ASP.NET Core in .NET 8 to ASP.NET Core in .NET 9
33
author: wadepickett
44
description: Learn how to migrate an ASP.NET Core in .NET 8 to ASP.NET Core in .NET 9.
55
ms.author: wpickett
6-
ms.date: 2/11/2024
6+
ms.date: 05/06/2026
77
uid: migration/80-to-90
88
---
99
# Migrate from ASP.NET Core in .NET 8 to ASP.NET Core in .NET 9
@@ -78,7 +78,7 @@ Optimize the handling of static files in your web apps by replacing <xref:Micros
7878
+ app.MapStaticAssets();
7979
```
8080

81-
In MVC & Razor Pages apps you additionally need to chain a call to `.WithStaticAssets` after `MapRazorPages` or `MapControllerRoute` in `Program.cs`. For an example, see the <xref:fundamentals/static-files?view=aspnetcore-9.0&preserve-view=true>.
81+
In MVC & Razor Pages apps, you additionally need to chain a call to `.WithStaticAssets` after `MapRazorPages` or `MapControllerRoute` in `Program.cs`. For an example, see the <xref:fundamentals/static-files?view=aspnetcore-9.0&preserve-view=true>.
8282

8383
ASP.NET Core automatically fingerprints and precompresses your static files at build and publish time, and then <xref:Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.MapStaticAssets%2A> surfaces the optimized files as endpoints using endpoint routing with appropriate caching headers.
8484

@@ -94,7 +94,7 @@ To resolve the fingerprinted file names from your app:
9494
9595
* In MVC & Razor Pages apps, the script and link tag helpers will automatically resolve the fingerprinted file names.
9696
97-
To resolve the fingerprinted file names when importing JavaScript modules, add a generated [import map](https://developer.mozilla.org/docs/Web/HTML/Element/script/type/importmap):
97+
To resolve the fingerprinted file names when importing JavaScript modules, add a generated [import map](https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/script/type/importmap):
9898
9999
* In Blazor apps, add the (<xref:Microsoft.AspNetCore.Components.ImportMap>) component to the `<head>` content of the app's root component, typically in the `App` component (`App.razor`):
100100
@@ -103,7 +103,7 @@ To resolve the fingerprinted file names when importing JavaScript modules, add a
103103
```
104104

105105
* In MVC & Razor pages apps, add `<script type="importmap"></script>` to the head of the main layout file, which is updated by the Import Map Tag Helper.
106-
106+
107107
For more information, see the following resources:
108108

109109
* <xref:aspnetcore-9#static-asset-delivery-optimization>

aspnetcore/tutorials/getting-started-with-NSwag.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use NSwag to generate documentation and help pages for
55
ms.author: wpickett
66
ms.custom: mvc
77
monikerRange: ">= aspnetcore-3.1 <= aspnetcore-8.0"
8-
ms.date: 02/07/2025
8+
ms.date: 05/11/2026
99
uid: tutorials/get-started-with-nswag
1010
---
1111
# Get started with NSwag and ASP.NET Core
@@ -21,7 +21,7 @@ NSwag offers the following capabilities:
2121
* The ability to utilize the Swagger UI and Swagger generator.
2222
* Flexible code generation capabilities.
2323

24-
With NSwag, you don't need an existing API&mdash;you can use third-party APIs that incorporate Swagger and generate a client implementation. NSwag allows you to expedite the development cycle and easily adapt to API changes.
24+
With NSwag, you don't need an existing API&mdash;you can use partner APIs that incorporate Swagger and generate a client implementation. NSwag allows you to expedite the development cycle and easily adapt to API changes.
2525

2626
## Package installation
2727

@@ -50,14 +50,14 @@ Use one of the following approaches to install the NSwag NuGet package:
5050
* Right-click the project in **Solution Explorer** > **Manage NuGet Packages**
5151
* Set the **Package source** to "nuget.org"
5252
* Enter "NSwag.AspNetCore" in the search box
53-
* Select the "NSwag.AspNetCore" package from the **Browse** tab and click **Install**
53+
* Select the "NSwag.AspNetCore" package from the **Browse** tab and select **Install**
5454
5555
### [Visual Studio for Mac](#tab/visual-studio-mac)
5656
5757
* Right-click the *Packages* folder in **Solution Pad** > **Add Packages...**
5858
* Set the **Add Packages** window's **Source** drop-down to "nuget.org"
5959
* Enter "NSwag.AspNetCore" in the search box
60-
* Select the "NSwag.AspNetCore" package from the results pane and click **Add Package**
60+
* Select the "NSwag.AspNetCore" package from the results pane and select **Add Package**
6161
6262
### [Visual Studio Code](#tab/visual-studio-code)
6363
@@ -105,14 +105,14 @@ You can take advantage of NSwag's code generation capabilities by choosing one o
105105

106106
### Generate code with NSwagStudio
107107

108-
* Install NSwagStudio by following the instructions at the [NSwagStudio GitHub repository](https://github.com/RicoSuter/NSwag/wiki/NSwagStudio). On the NSwag release page, you can download an xcopy version which can be started without installation and admin privileges.
108+
* Install NSwagStudio by following the instructions at the [NSwagStudio GitHub repository](https://github.com/RicoSuter/NSwag/wiki/NSwagStudio). On the NSwag release page, you can download an xcopy version, which can be started without installation and admin privileges.
109109
* Launch NSwagStudio and enter the `swagger.json` file URL in the **Swagger Specification URL** text box. For example, `http://localhost:5232/swagger/v1/swagger.json`.
110-
* Click the **Create local Copy** button to generate a JSON representation of your Swagger specification.
110+
* Select the **Create local Copy** button to generate a JSON representation of your Swagger specification.
111111

112112
:::image source="web-api-help-pages-using-swagger/_static/v6-nswag-NSwagStudio.png" alt-text="NSwag Studio imports the specification and exports a CSharp Client.":::
113113

114-
* In the **Outputs** area, click the **CSharp Client** checkbox. Depending on your project, you can also choose **TypeScript Client** or **CSharp Web API Controller**. If you select **CSharp Web API Controller**, a service specification rebuilds the service, serving as a reverse generation.
115-
* Click **Generate Outputs** to produce a complete C# client implementation of the *TodoApi.NSwag* project. To see the generated client code, click the **CSharp Client** tab:
114+
* In the **Outputs** area, select the **CSharp Client** checkbox. Depending on your project, you can also choose **TypeScript Client** or **CSharp Web API Controller**. If you select **CSharp Web API Controller**, a service specification rebuilds the service, serving as a reverse generation.
115+
* Select **Generate Outputs** to produce a complete C# client implementation of the *TodoApi.NSwag* project. To see the generated client code, select the **CSharp Client** tab:
116116

117117
:::code language="csharp" source="web-api-help-pages-using-swagger/_static/v6-nswag-generated-todoclient.cs" range="19-55":::
118118

@@ -152,7 +152,7 @@ To enable XML comments, perform the following steps:
152152

153153
#### [Visual Studio for Mac](#tab/visual-studio-mac)
154154

155-
* From the *Solution Pad*, press **control** and click the project name. Navigate to **Tools** > **Edit File**.
155+
* From the *Solution Pad*, press **control** and select the project name. Navigate to **Tools** > **Edit File**.
156156
* Manually add the highlighted lines to the `.csproj` file:
157157

158158
:::code language="xml" source="web-api-help-pages-using-swagger/samples/7.x/NSwagSample/NSwagSample.csproj" id="snippet_GenerateDocumentationFile" highlight="2":::
@@ -171,7 +171,7 @@ Manually add the highlighted lines to the `.csproj` file:
171171

172172
---
173173

174-
Enabling XML comments provides debug information for undocumented public types and members. Undocumented types and members are indicated by the warning message. For example, the following message indicates a violation of warning code 1591:
174+
Enabling XML comments provides debug information for undocumented public types and members. The warning message indicates documented types and members. For example, the following message indicates a violation of warning code 1591:
175175

176176
```text
177177
warning CS1591: Missing XML comment for publicly visible type or member 'TodoContext'
@@ -181,7 +181,7 @@ To suppress warnings project-wide, define a semicolon-delimited list of warning
181181

182182
:::code language="xml" source="web-api-help-pages-using-swagger/samples/7.x/NSwagSample/NSwagSample.csproj" id="snippet_GenerateDocumentationFileWithNoWarn" highlight="3":::
183183

184-
To suppress warnings only for specific members, enclose the code in [#pragma warning](/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-pragma-warning) preprocessor directives. This approach is useful for code that shouldn't be exposed via the API docs. In the following example, warning code CS1591 is ignored for the entire `TodoContext` class. Enforcement of the warning code is restored at the close of the class definition. Specify multiple warning codes with a comma-delimited list.
184+
To suppress warnings only for specific members, enclose the code in [#pragma warning](/dotnet/csharp/language-reference/preprocessor-directives#pragma-warning) preprocessor directives. This approach is useful for code that shouldn't be exposed via the API docs. In the following example, warning code CS1591 is ignored for the entire `TodoContext` class. Enforcement of the warning code is restored at the close of the class definition. Specify multiple warning codes with a comma-delimited list.
185185

186186
:::code language="csharp" source="web-api-help-pages-using-swagger/samples/7.x/NSwagSample/Models/TodoContext.cs" id="snippet_PragmaWarningDisable" highlight="3,10":::
187187

@@ -256,8 +256,8 @@ Use one of the following approaches to install the NSwag NuGet package:
256256
### [Visual Studio](#tab/visual-studio)
257257

258258
* From the **Package Manager Console** window:
259-
* Go to **View** > **Other Windows** > **Package Manager Console**
260-
* Navigate to the directory in which the `TodoApi.csproj` file exists
259+
* Go to **View** > **Other Windows** > **Package Manager Console**.
260+
* Navigate to the directory in which the `TodoApi.csproj` file exists.
261261
* Execute the following command:
262262

263263
```powershell
@@ -272,10 +272,10 @@ Use one of the following approaches to install the NSwag NuGet package:
272272
273273
### [Visual Studio for Mac](#tab/visual-studio-mac)
274274
275-
* Right-click the *Packages* folder in **Solution Pad** > **Add Packages...**
276-
* Set the **Add Packages** window's **Source** drop-down to "nuget.org"
277-
* Enter "NSwag.AspNetCore" in the search box
278-
* Select the "NSwag.AspNetCore" package from the results pane and click **Add Package**
275+
* Right-click the *Packages* folder in **Solution Pad** > **Add Packages...**.
276+
* Set the **Add Packages** window's **Source** drop-down to "nuget.org".
277+
* Enter "NSwag.AspNetCore" in the search box.
278+
* Select the "NSwag.AspNetCore" package from the results pane and click **Add Package**.
279279
280280
### [Visual Studio Code](#tab/visual-studio-code)
281281

aspnetcore/tutorials/razor-pages/new-field.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Part 7, add a new field
33
author: wadepickett
44
description: Part 7 of tutorial series on Razor Pages.
55
ms.author: wpickett
6-
ms.date: 06/23/2024
6+
ms.date: 05/11/2026
77
uid: tutorials/razor-pages/new-field
88
---
99
# Part 7, add a new field to a Razor Page in ASP.NET Core
@@ -75,11 +75,12 @@ From the *View* menu, select *Terminal* and enter the following command:
7575
```dotnetcli
7676
dotnet build
7777
```
78+
7879
---
7980

8081
# [Visual Studio](#tab/visual-studio)
8182

82-
### Add a migration for the rating field
83+
## Add a migration for the rating field
8384

8485
1. From the **Tools** menu, select **NuGet Package Manager > Package Manager Console**.
8586
1. In the Package Manager Console (PMC), enter the following command:
@@ -119,7 +120,7 @@ Another option is to delete the database and use migrations to re-create the dat
119120

120121
# [Visual Studio Code](#tab/visual-studio-code)
121122

122-
### Add a migration for rating
123+
## Add a migration for rating
123124

124125
Use the following commands to add a migration for the rating field:
125126

@@ -137,7 +138,7 @@ The name `rating` is arbitrary and is used to name the migration file. Use a mea
137138

138139
The `dotnet ef database update` command applies the schema changes to the database and preserves existing data.
139140

140-
If you delete all the records in the database, the initializer seeds the database and includes the `Rating` field.
141+
If you delete all the records in the database, the initializer seeds the database and includes the `Rating` field.
141142

142143
### Optional: Drop and re-create the database for other providers
143144

aspnetcore/tutorials/web-api-javascript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to call an ASP.NET Core web API with JavaScript.
55
ms.author: wpickett
66
monikerRange: '>= aspnetcore-3.1'
77
ms.custom: mvc, devx-track-js
8-
ms.date: 04/24/2024
8+
ms.date: 05/12/2026
99
uid: tutorials/web-api-javascript
1010
---
1111
# Tutorial: Call an ASP.NET Core web API with JavaScript
@@ -50,7 +50,7 @@ The simplest `fetch` call accepts a single parameter representing the route. A s
5050

5151
[!code-javascript[](~/tutorials/first-web-api/samples/6.0/TodoApi/wwwroot/js/site.js?name=snippet_SiteJs)]
5252

53-
A change to the ASP.NET Core project's launch settings may be required to test the HTML page locally:
53+
A change to the ASP.NET Core project's launch settings might be required to test the HTML page locally:
5454

5555
1. Open *Properties\launchSettings.json*.
5656
1. Remove the `launchUrl` property to force the app to open at `index.html`&mdash;the project's default file.

0 commit comments

Comments
 (0)