Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aspnetcore/migration/fx-to-core/areas/http-handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ One solution is to branch the pipeline for requests with a given extension, usin

Middleware added to the pipeline before the branch will be invoked on all requests; the branch will have no impact on them.

<xref:Microsoft.AspNetCore.Builder.MapWhenExtensions.MapWhen*> creates a separate branch. When the predicate returns `true`, only the middleware added to the branch runs, and middleware registered on the main pipeline after `MapWhen` doesn't run for that request. To run middleware conditionally and then continue with the rest of the pipeline, use <xref:Microsoft.AspNetCore.Builder.UseWhenExtensions.UseWhen*> instead. `UseWhen` doesn't create a separate branch, so middleware registered after it runs whether the predicate returns `true` or `false`, unless the conditional middleware short-circuits the request. For more information, see [Branch the middleware pipeline](../../../fundamentals/middleware/index.md#branch-the-middleware-pipeline).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change LGTM ☝️.


For additional details, see the [middleware documentation](../../../fundamentals/middleware/index.md) for additional ways to use middleware to replace your usage of handlers.

## Migrating to the new HttpContext
Expand Down