-
Notifications
You must be signed in to change notification settings - Fork 10.4k
SignalR additional xml docs #7980
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,15 @@ namespace Microsoft.AspNetCore.Http.Connections | |
{ | ||
public static class HttpConnectionContextExtensions | ||
{ | ||
/// <summary> | ||
/// Gets the <see cref="HttpContext"/> associated with the connection, if there is one. | ||
/// </summary> | ||
/// <param name="connection">The <see cref="ConnectionContext"/> representing the connection.</param> | ||
/// <returns>The <see cref="HttpContext"/> associated with the connection, or <see langword="null"/> if the connection is not HTTP-based.</returns> | ||
/// <remarks> | ||
/// SignalR connections can run on top of HTTP transports like WebSockets or Long Polling, or other non-HTTP transports. As a result, | ||
/// this method can sometimes return <see langword="null"/> depending on the configuration of your application. | ||
/// </remarks> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a remark, beware that this won't show up in intellisense or the HttpConnectionContextExtensions generated docs. To see this you will have to got to the generated docs page dedicated exclusively to the GetHttpContext() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think I'll put |
||
public static HttpContext GetHttpContext(this ConnectionContext connection) | ||
{ | ||
return connection.Features.Get<IHttpContextFeature>()?.HttpContext; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I normally prefer printing$"{exception}" over $ "{exception.Message}" so you get the Exception type and stack trace too.