Skip to content

Commit 7498cea

Browse files
authored
Improve endpoint extension method docs (#56713)
1 parent f3db10e commit 7498cea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Http/Http.Abstractions/src/Routing/EndpointHttpContextExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public static class EndpointHttpContextExtensions
1414
/// Extension method for getting the <see cref="Endpoint"/> for the current request.
1515
/// </summary>
1616
/// <param name="context">The <see cref="HttpContext"/> context.</param>
17-
/// <returns>The <see cref="Endpoint"/>.</returns>
17+
/// <returns>The <see cref="Endpoint"/> or <c>null</c> if the request doesn't have an endpoint.</returns>
18+
/// <remarks>
19+
/// The endpoint for a request is typically set by routing middleware. A request might not have
20+
/// an endpoint if routing middleware hasn't run yet, or the request didn't match a route.
21+
/// </remarks>
1822
public static Endpoint? GetEndpoint(this HttpContext context)
1923
{
2024
ArgumentNullException.ThrowIfNull(context);
@@ -26,7 +30,7 @@ public static class EndpointHttpContextExtensions
2630
/// Extension method for setting the <see cref="Endpoint"/> for the current request.
2731
/// </summary>
2832
/// <param name="context">The <see cref="HttpContext"/> context.</param>
29-
/// <param name="endpoint">The <see cref="Endpoint"/>.</param>
33+
/// <param name="endpoint">The <see cref="Endpoint"/>. A <c>null</c> value clears the endpoint for the current request.</param>
3034
public static void SetEndpoint(this HttpContext context, Endpoint? endpoint)
3135
{
3236
ArgumentNullException.ThrowIfNull(context);

0 commit comments

Comments
 (0)