Skip to content

Commit 4486241

Browse files
authored
Middleware article overhaul (#36616)
1 parent d55c12c commit 4486241

55 files changed

Lines changed: 995 additions & 1658 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

aspnetcore/blazor/host-and-deploy/app-base-path.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ In many hosting scenarios, the relative URL path to the app is the root of the a
244244
:::moniker-end
245245

246246
> [!NOTE]
247-
> When using <xref:Microsoft.AspNetCore.Builder.WebApplication> (see <xref:migration/50-to-60#new-hosting-model>), [`app.UseRouting`](xref:Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseRouting%2A) must be called after <xref:Microsoft.AspNetCore.Builder.UsePathBaseExtensions.UsePathBase%2A> so that the Routing Middleware can observe the modified path before matching routes. Otherwise, routes are matched before the path is rewritten by <xref:Microsoft.AspNetCore.Builder.UsePathBaseExtensions.UsePathBase%2A> as described in the [Middleware Ordering](xref:fundamentals/middleware/index#order) and [Routing](xref:fundamentals/routing) articles.
247+
> When using <xref:Microsoft.AspNetCore.Builder.WebApplication> (see <xref:migration/50-to-60#new-hosting-model>), [`app.UseRouting`](xref:Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseRouting%2A) must be called after <xref:Microsoft.AspNetCore.Builder.UsePathBaseExtensions.UsePathBase%2A> so that the Routing Middleware can observe the modified path before matching routes. Otherwise, routes are matched before the path is rewritten by <xref:Microsoft.AspNetCore.Builder.UsePathBaseExtensions.UsePathBase%2A> as described in the <xref:fundamentals/middleware/index#middleware-order> and <xref:fundamentals/routing>.
248248
249249
Don't prefix links throughout the app with a forward slash. Either avoid the use of a path segment separator or use dot-slash (`./`) relative path notation:
250250

aspnetcore/data/ef-rp/update-related-data.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Update `Pages/Courses/Create.cshtml.cs` with the following code:
4646

4747
[!code-csharp[](intro/samples/cu50/Pages/Courses/Create.cshtml.cs?highlight=7,18,27-41)]
4848

49-
[!INCLUDE[loc comments](~/includes/code-comments-loc.md)]
50-
5149
The preceding code:
5250

5351
* Derives from `DepartmentNamePageModel`.
@@ -269,8 +267,6 @@ Update `Pages/Courses/Create.cshtml.cs` with the following code:
269267

270268
[!code-csharp[](intro/samples/cu30/Pages/Courses/Create.cshtml.cs?highlight=7,18,27-41)]
271269

272-
[!INCLUDE[about the series](~/includes/code-comments-loc.md)]
273-
274270
The preceding code:
275271

276272
* Derives from `DepartmentNamePageModel`.

aspnetcore/fundamentals/app-state.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The following code shows how to set up the in-memory session provider with a def
9292

9393
The preceding code sets a short timeout to simplify testing.
9494

95-
The order of middleware is important. Call `UseSession` after `UseRouting` and before `MapRazorPages` and `MapDefaultControllerRoute` . See [Middleware Ordering](xref:fundamentals/middleware/index#order).
95+
The order of middleware is important. Call `UseSession` after `UseRouting` and before `MapRazorPages` and `MapDefaultControllerRoute`. See [Middleware Ordering](xref:fundamentals/middleware/index#middleware-order).
9696

9797
[HttpContext.Session](xref:Microsoft.AspNetCore.Http.HttpContext.Session) is available after session state is configured.
9898

@@ -376,7 +376,7 @@ The following code shows how to set up the in-memory session provider with a def
376376

377377
The preceding code sets a short timeout to simplify testing.
378378

379-
The order of middleware is important. Call `UseSession` after `UseRouting` and before `UseEndpoints`. See [Middleware Ordering](xref:fundamentals/middleware/index#order).
379+
The order of middleware is important. Call `UseSession` after `UseRouting` and before `UseEndpoints`. For more information, see <xref:fundamentals/middleware/index#middleware-order>.
380380

381381
[HttpContext.Session](xref:Microsoft.AspNetCore.Http.HttpContext.Session) is available after session state is configured.
382382

aspnetcore/fundamentals/http-requests.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,6 @@ Typed clients:
890890
A typed client accepts an `HttpClient` parameter in its constructor:
891891

892892
:::code language="csharp" source="http-requests/samples/3.x/HttpClientFactorySample/GitHub/GitHubService.cs" id="snippet1" highlight="5":::
893-
[!INCLUDE[about the series](~/includes/code-comments-loc.md)]
894893

895894
In the preceding code:
896895

aspnetcore/fundamentals/localization/includes/localization35.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,6 @@ The current culture on a request is set in the localization [Middleware](xref:fu
255255

256256
[!code-csharp[](~/fundamentals/localization/sample/3.x/Localization/Startup.cs?name=snippet2)]
257257

258-
[!INCLUDE[about the series](~/includes/code-comments-loc.md)]
259-
260258
`UseRequestLocalization` initializes a `RequestLocalizationOptions` object. On every request the list of `RequestCultureProvider` in the `RequestLocalizationOptions` is enumerated and the first provider that can successfully determine the request culture is used. The default providers come from the `RequestLocalizationOptions` class:
261259

262260
1. `QueryStringRequestCultureProvider`

aspnetcore/fundamentals/middleware/index.md

Lines changed: 982 additions & 123 deletions
Large diffs are not rendered by default.

aspnetcore/fundamentals/middleware/index/includes/VertGraph.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)