Skip to content

.NET 6 update: prefer new Use middleware extension method #23688

@Rick-Anderson

Description

@Rick-Anderson

Add a new app.Use overload that requires users to pass the HttpContext to the next function which will save 2 per-request allocations over the previous extension method.

Customer Impact

Less per-request allocations when using simple middleware.

See dotnet/aspnetcore#31784


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help wantedUp for grabs. We would accept a PR to help resolve this issueSource - Docs.msDocs Customer feedback via GitHub Issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions