Skip to content

Commit 65a873f

Browse files
committed
Address final review feedback.
1 parent 9e757bf commit 65a873f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/Http/Http.Extensions/src/RequestDelegateFactory.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace Microsoft.AspNetCore.Http
2020
{
2121
/// <summary>
22-
/// Builds <see cref="RequestDelegate"/> implementations from <see cref="Delegate"/> request handlers.
22+
/// Creates <see cref="RequestDelegate"/> implementations from <see cref="Delegate"/> request handlers.
2323
/// </summary>
2424
public static class RequestDelegateFactory
2525
{
@@ -47,10 +47,10 @@ public static class RequestDelegateFactory
4747
private static readonly MemberExpression RequestAbortedExpr = Expression.Property(HttpContextParameter, nameof(HttpContext.RequestAborted));
4848

4949
/// <summary>
50-
/// Builds a <see cref="RequestDelegate"/> implementation for <paramref name="action"/>.
50+
/// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="action"/>.
5151
/// </summary>
5252
/// <param name="action">A request handler with any number of custom parameters that often produces a response with its return value.</param>
53-
/// <returns>The <see cref="RequestDelegate"/></returns>
53+
/// <returns>The <see cref="RequestDelegate"/>.</returns>
5454
public static RequestDelegate Create(Delegate action)
5555
{
5656
if (action is null)
@@ -60,11 +60,11 @@ public static RequestDelegate Create(Delegate action)
6060

6161
var targetExpression = action.Target switch
6262
{
63-
{ } => Expression.Convert(TargetArg, action.Target.GetType()),
63+
object => Expression.Convert(TargetArg, action.Target.GetType()),
6464
null => null,
6565
};
6666

67-
var untargetedRequestDelegate = BuildRequestDelegate(action.Method, targetExpression);
67+
var untargetedRequestDelegate = CreateRequestDelegate(action.Method, targetExpression);
6868

6969
return httpContext =>
7070
{
@@ -73,18 +73,18 @@ public static RequestDelegate Create(Delegate action)
7373
}
7474

7575
/// <summary>
76-
/// Builds a <see cref="RequestDelegate"/> implementation for <paramref name="methodInfo"/>.
76+
/// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="methodInfo"/>.
7777
/// </summary>
7878
/// <param name="methodInfo">A static request handler with any number of custom parameters that often produces a response with its return value.</param>
79-
/// <returns>The <see cref="RequestDelegate"/></returns>
79+
/// <returns>The <see cref="RequestDelegate"/>.</returns>
8080
public static RequestDelegate Create(MethodInfo methodInfo)
8181
{
8282
if (methodInfo is null)
8383
{
8484
throw new ArgumentNullException(nameof(methodInfo));
8585
}
8686

87-
var untargetedRequestDelegate = BuildRequestDelegate(methodInfo, targetExpression: null);
87+
var untargetedRequestDelegate = CreateRequestDelegate(methodInfo, targetExpression: null);
8888

8989
return httpContext =>
9090
{
@@ -93,11 +93,11 @@ public static RequestDelegate Create(MethodInfo methodInfo)
9393
}
9494

9595
/// <summary>
96-
/// Builds a <see cref="RequestDelegate"/> implementation for <paramref name="methodInfo"/>.
96+
/// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="methodInfo"/>.
9797
/// </summary>
9898
/// <param name="methodInfo">A request handler with any number of custom parameters that often produces a response with its return value.</param>
9999
/// <param name="targetFactory">Creates the <see langword="this"/> for the non-static method.</param>
100-
/// <returns>The <see cref="RequestDelegate"/></returns>
100+
/// <returns>The <see cref="RequestDelegate"/>.</returns>
101101
public static RequestDelegate Create(MethodInfo methodInfo, Func<HttpContext, object> targetFactory)
102102
{
103103
if (methodInfo is null)
@@ -116,15 +116,15 @@ public static RequestDelegate Create(MethodInfo methodInfo, Func<HttpContext, ob
116116
}
117117

118118
var targetExpression = Expression.Convert(TargetArg, methodInfo.DeclaringType);
119-
var untargetedRequestDelegate = BuildRequestDelegate(methodInfo, targetExpression);
119+
var untargetedRequestDelegate = CreateRequestDelegate(methodInfo, targetExpression);
120120

121121
return httpContext =>
122122
{
123123
return untargetedRequestDelegate(targetFactory(httpContext), httpContext);
124124
};
125125
}
126126

127-
private static Func<object?, HttpContext, Task> BuildRequestDelegate(MethodInfo methodInfo, Expression? targetExpression)
127+
private static Func<object?, HttpContext, Task> CreateRequestDelegate(MethodInfo methodInfo, Expression? targetExpression)
128128
{
129129
// Non void return type
130130

0 commit comments

Comments
 (0)