Middleware in Minimal API: Add links (#31857)

pull/31858/head
Wade Pickett 2024-02-16 19:52:09 -08:00 committed by GitHub
parent 2f56d2d0d0
commit 2fbb27b521
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
:::moniker range="= aspnetcore-7.0"
`WebApplication` automatically adds the following middleware depending on certain conditions:
[`WebApplication`](xref:fundamentals/minimal-apis/webapplication) automatically adds the following middleware in [`Minimal API applications`](xref:fundamentals/minimal-apis/overview) depending on certain conditions:
* [`UseDeveloperExceptionPage`](/dotnet/api/microsoft.aspnetcore.diagnostics.developerexceptionpagemiddleware) is added first when the [`HostingEnvironment`](xref:fundamentals/environments) is `"Development"`.
* [`UseRouting`](/dotnet/api/microsoft.aspnetcore.builder.endpointroutingapplicationbuilderextensions.userouting) is added second if user code didn't already call `UseRouting` and if there are endpoints configured, for example `app.MapGet`.
* [`UseEndpoints`](/dotnet/api/microsoft.aspnetcore.builder.endpointroutingapplicationbuilderextensions.useendpoints) is added at the end of the middleware pipeline if any endpoints are configured.

View File

@ -1,6 +1,6 @@
:::moniker range=">= aspnetcore-8.0"
`WebApplication` automatically adds the following middleware depending on certain conditions:
[`WebApplication`](xref:fundamentals/minimal-apis/webapplication) automatically adds the following middleware in [`Minimal API applications`](xref:fundamentals/minimal-apis/overview) depending on certain conditions:
* [`UseDeveloperExceptionPage`](/dotnet/api/microsoft.aspnetcore.diagnostics.developerexceptionpagemiddleware) is added first when the [`HostingEnvironment`](xref:fundamentals/environments) is `"Development"`.
* [`UseRouting`](/dotnet/api/microsoft.aspnetcore.builder.endpointroutingapplicationbuilderextensions.userouting) is added second if user code didn't already call `UseRouting` and if there are endpoints configured, for example `app.MapGet`.
* [`UseEndpoints`](/dotnet/api/microsoft.aspnetcore.builder.endpointroutingapplicationbuilderextensions.useendpoints) is added at the end of the middleware pipeline if any endpoints are configured.

View File

@ -3,7 +3,7 @@ title: Middleware with Minimal API applications
author: BrennanConroy
description: Use middleware in Minimal API applications
ms.author: brecon
ms.date: 8/25/2023
ms.date: 02/16/2024
monikerRange: '>= aspnetcore-7.0'
uid: fundamentals/minimal-apis/middleware
---
@ -14,3 +14,5 @@ uid: fundamentals/minimal-apis/middleware
[!INCLUDE [webapplication8](~/fundamentals/minimal-apis/includes/middleware8.md)]
For more information about middleware see [ASP.NET Core Middleware](xref:fundamentals/middleware/index), and the [list of built-in middleware](xref:fundamentals/middleware/index#built-in-middleware) that can be added to applications.
For more information about Minimal APIs see [`Minimal APIs overview`](xref:fundamentals/minimal-apis/overview).