אירוע
Power BI DataViz World Championships
14 בפבר׳, 16 - 31 במרץ, 16
עם 4 הזדמנויות להיכנס, אתה יכול לזכות בחבילה ועידה ולהיכנס ל-LIVE Grand Finale בלאס וגאס
למידע נוסףהדפדפן הזה אינו נתמך עוד.
שדרג ל- Microsoft Edge כדי לנצל את התכונות, עדכוני האבטחה והתמיכה הטכנית העדכניים ביותר.
IHttpContextAccessor
/HttpContext
in ASP.NET Core SignalRהערה
This isn't the latest version of this article. For the current release, see the .NET 9 version of this article.
חשוב
This information relates to a pre-release product that may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
For the current release, see the .NET 9 version of this article.
IHttpContextAccessor/HttpContext generally should be avoided with SignalR because a valid HttpContext isn't always available. In most cases, the context doesn't exist (null
).
Even when an HttpContext instance is available, the context is dependent on the transport:
When working within a SignalR hub, you can access the HttpContext directly using the GetHttpContextExtensions.GetHttpContext method. This method returns the HttpContext for the current connection or null
if the connection isn't associated with an HTTP request. This is particularly useful for retrieving HTTP connection information, such as headers and query strings, directly within the hub. We recommend calling this method over IHttpContextAccessor for accessing HttpContext in the hub. For more information, see Use hubs in ASP.NET Core SignalR.
For guidance on IHttpContextAccessor/HttpContext in ASP.NET Core Blazor apps, see IHttpContextAccessor/HttpContext in ASP.NET Core Blazor apps.
משוב של ASP.NET Core
ASP.NET Core הוא פרויקט קוד פתוח. בחר קישור כדי לספק משוב:
אירוע
Power BI DataViz World Championships
14 בפבר׳, 16 - 31 במרץ, 16
עם 4 הזדמנויות להיכנס, אתה יכול לזכות בחבילה ועידה ולהיכנס ל-LIVE Grand Finale בלאס וגאס
למידע נוסףהדרכה
מודול
החלפת תשאול בצד הלקוח ב- ASP.NET Core SignalR - Training
במודול זה, עליך להשתמש ASP.NET Core SignalR כדי להחליף את פונקציונליות התשאול בצד הלקוח ביישום אינטרנט קיים.