Skip to content

Conversation

@guardrex
Copy link
Collaborator

@guardrex guardrex commented Jan 13, 2026

Fixes #35805

I performed a general pass as I seek to make it Blazor friendly.

There's one question that I have in here of a technical nature: For Use delegate overload that passes the HttpContext to next for performance, why aren't we pitching that overload in all general use cases if it provides a perf improvement? Looking at it another way, what are the caveats/gotchas 😈 that we can state in the section for when it shouldn't be called?

Do you want to continue with the INCLUDES file versioning approach? 👂 If not, I'll roll the 3-7 file in here by section with versioning to get it down to one file (and no broken links in prior release content).

I'll remove the inline reviewer comments after we're done with reviews before merging.


Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
aspnetcore/blazor/host-and-deploy/app-base-path.md aspnetcore/blazor/host-and-deploy/app-base-path
aspnetcore/data/ef-rp/update-related-data.md aspnetcore/data/ef-rp/update-related-data
aspnetcore/fundamentals/app-state.md aspnetcore/fundamentals/app-state
aspnetcore/fundamentals/http-requests.md aspnetcore/fundamentals/http-requests
aspnetcore/fundamentals/middleware/index.md aspnetcore/fundamentals/middleware/index
aspnetcore/fundamentals/middleware/request-response.md aspnetcore/fundamentals/middleware/request-response
aspnetcore/grpc/aspnetcore.md aspnetcore/grpc/aspnetcore
aspnetcore/grpc/basics.md aspnetcore/grpc/basics
aspnetcore/host-and-deploy/linux-nginx.md aspnetcore/host-and-deploy/linux-nginx
aspnetcore/host-and-deploy/proxy-load-balancer.md aspnetcore/host-and-deploy/proxy-load-balancer
aspnetcore/mvc/advanced/custom-model-binding.md aspnetcore/mvc/advanced/custom-model-binding
aspnetcore/mvc/controllers/filters.md aspnetcore/mvc/controllers/filters
aspnetcore/performance/response-compression.md aspnetcore/performance/response-compression
aspnetcore/security/authentication/cookie.md aspnetcore/security/authentication/cookie
aspnetcore/security/data-protection/implementation/key-management.md aspnetcore/security/data-protection/implementation/key-management
aspnetcore/security/data-protection/implementation/key-storage-providers.md aspnetcore/security/data-protection/implementation/key-storage-providers
aspnetcore/signalr/authn-and-authz.md aspnetcore/signalr/authn-and-authz

@guardrex guardrex self-assigned this Jan 13, 2026
@guardrex guardrex marked this pull request as ready for review January 20, 2026 12:34
@guardrex guardrex requested a review from Copilot January 20, 2026 12:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR performs a comprehensive overhaul of the middleware article and related documentation to make it more Blazor-friendly. The changes include removing obsolete include files, updating cross-references, deleting old snapshot code files, adding a new SVG diagram, and inlining code samples that were previously in separate files.

Changes:

  • Removes code-comments-loc.md and ForwardedHeaders.md include files and replaces their usage with inline content
  • Deletes multiple snapshot code files and mermaid diagram files that are no longer needed
  • Adds new filter-pipeline-3.svg diagram for the filters article
  • Updates cross-reference links to use consistent fragment identifiers (e.g., #middleware-order instead of #order)
  • Inlines code samples throughout the middleware article for better maintainability

Reviewed changes

Copilot reviewed 53 out of 55 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
aspnetcore/includes/code-comments-loc.md Deleted include file for code comments localization notice
aspnetcore/includes/ForwardedHeaders.md Deleted include file for Forwarded Headers Middleware ordering
aspnetcore/fundamentals/middleware/index/includes/*.md Deleted multiple versioned middleware article includes
aspnetcore/fundamentals/middleware/index/snapshot/*.cs Deleted snapshot code files
aspnetcore/mvc/controllers/filters/_static/filter-pipeline-3.svg Added new SVG diagram showing filter pipeline
aspnetcore/fundamentals/middleware/index/includes/index3-7.md Inlined code samples and removed include references
Multiple .md files Updated xref links and removed include file references

@guardrex guardrex requested a review from tdykstra January 20, 2026 12:49
@guardrex
Copy link
Collaborator Author

guardrex commented Jan 22, 2026

@BrennanConroy ... Hi and Happy New Year! 🥳 ...

Could you answer a question for me about what Rick added to the Middleware article at ...

Prefer app.Use overload that requires passing the context to next

... relative to the discussion on ...

dotnet/aspnetcore#31463

The current article section is guiding devs to the overload almost as an afterthought, but it looks like you intend to recommend it over the earlier non-context-passed overload, except in the case of terminal middleware when Run should be used (warning devs off of Use without next via the analyzer).

If that's correct, I'll make the updates on this PR, which is an overhaul of the whole article. This has come up here because we're in the process of Blazorfying™ 😄 the main doc set's Fundamentals articles, and I noticed this potential problem in passing.

If I'm headed in the right direction, is it best to keep both overloads, describing and recommending the new overload first (are there gotchas 😈 where the prior overload is best)? Alternatively, would it be better to not describe the earlier (non-context-passed) overload at all and only cover the context-passed one? [Note that the content I'm directly addressing is >=8.0, but I will go back and make updates to 6.0 and 7.0 coverage on this subject.]

cc: @danroth27

@BrennanConroy
Copy link
Member

We should probably promote it as the only Use overload you should use. Don't think we even need to mention the other one.

@guardrex
Copy link
Collaborator Author

Thanks, @BrennanConroy ... Will do. 👍

@guardrex
Copy link
Collaborator Author

guardrex commented Jan 23, 2026

@tdykstra ... It's ready for review now. 🎉

... AND ....

Let me know if you want me to get rid of the .NET 3 to 7 INCLUDES file and roll the content into each section with versioning in one markdown file for no broken bookmarks in prior release content and a lot less duplicate content. I can work it out if you want, and we can pick back up on Monday with the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update "ASP.NET Core Middleware" to remove unrelated MVC & Razor Pages content and focus instead on Blazor

3 participants