Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpContext/IHttpContextAccessor article #34592

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Jan 29, 2025

Fixes #34587
Fixes #14974

NoTeS

  • Includes trying to close the issue you, Javier, opened for the SignalR doc set.
  • Not sure on the placement of the SignalR article. Did you prefer just a section? Where do you want the article in the ToC, or where do you want the section if I take that content and make it into a section? IMO, Blazor should have this guidance surfaced better than a section. Pop open the whole Blazor article on the DIFF to review the entire Blazor article. This gets rid of the INCLUDE that I was using before that was burying this content ... devs aren't always finding it as a section.
  • I'd like to keep the "advanced" cross-links. Dev are asking for more details, and the convos in those issues explain quite a bit, especially the discussion that you, Mackinnion, Steve, and I had on this subject. I hope we can keep it with the lingo that I placed, explaining that it's for "advanced" scenarios and that most devs won't need to look at it. However, I'm ready to 🔪 those cross-links if you want ... I'm just concerned that even more issues will come in if we do.

Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/components/httpcontext.md aspnetcore/blazor/components/httpcontext
aspnetcore/blazor/components/index.md aspnetcore/blazor/components/index
aspnetcore/blazor/fundamentals/signalr.md aspnetcore/blazor/fundamentals/signalr
aspnetcore/blazor/security/index.md aspnetcore/blazor/security/index
aspnetcore/blazor/security/interactive-server-side-rendering.md aspnetcore/blazor/security/interactive-server-side-rendering
aspnetcore/fundamentals/http-context.md aspnetcore/fundamentals/http-context
aspnetcore/signalr/httpcontext.md aspnetcore/signalr/httpcontext
aspnetcore/toc.yml aspnetcore/toc

@guardrex guardrex self-assigned this Jan 29, 2025
@guardrex guardrex requested a review from javiercn January 31, 2025 12:48
ms.date: 01/30/2025
uid: signalr/httpcontext
---
# `IHttpContextAccessor`/`HttpContext` in ASP.NET Core SignalR
Copy link
Member

Choose a reason for hiding this comment

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

For SignalR you should use Context.GetHttpContext() when in the hub. See https://learn.microsoft.com/aspnet/core/signalr/hubs?view=aspnetcore-9.0#the-context-object for details.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @BrennanConroy ... See if my last commit places a good paragraph for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@BrennanConroy ... pinging again in case you didn't see the earlier one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants