@@ -84,7 +84,7 @@ public static RequestDelegate Create(Delegate action)
8484
8585 /// <summary>
8686 /// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="methodInfo"/>.
87- /// </summary>Microsoft.AspNetCore.Routing.MapAction"
87+ /// </summary>
8888 /// <param name="methodInfo">A static request handler with any number of custom parameters that often produces a response with its return value.</param>
8989 /// <returns>The <see cref="RequestDelegate"/>.</returns>
9090 public static RequestDelegate Create ( MethodInfo methodInfo )
@@ -253,11 +253,7 @@ private static Expression CreateArgument(ParameterInfo parameter, FactoryContext
253253 {
254254 return RequestAbortedExpr ;
255255 }
256- else if ( parameter . ParameterType == typeof ( string ) )
257- {
258- return BindParameterFromRouteValueOrQueryString ( parameter , parameter . Name , factoryContext ) ;
259- }
260- else if ( HasTryParseMethod ( parameter ) )
256+ else if ( parameter . ParameterType == typeof ( string ) || HasTryParseMethod ( parameter ) )
261257 {
262258 return BindParameterFromRouteValueOrQueryString ( parameter , parameter . Name , factoryContext ) ;
263259 }
@@ -296,7 +292,7 @@ private static Expression CreateTryParseCheckingResponseWritingMethodCall(Method
296292 // if (!int.TryParse(tempSourceString, out parsedValue))
297293 // {
298294 // wasTryParseFailureVariable = true;
299- // Log.ParameterBindingFailed(httpContext, "Int32", "id", sourceValue )
295+ // Log.ParameterBindingFailed(httpContext, "Int32", "id", tempSourceString )
300296 // }
301297 //
302298 // return parsedValue;
@@ -635,7 +631,7 @@ private static Expression BindParameterFromValue(ParameterInfo parameter, Expres
635631 // if (!int.TryParse(tempSourceString, out parsedValue))
636632 // {
637633 // wasTryParseFailureVariable = true;
638- // Log.ParameterBindingFailed(httpContext, "Int32", "id", sourceValue )
634+ // Log.ParameterBindingFailed(httpContext, "Int32", "id", tempSourceString )
639635 // }
640636 //
641637 // return parsedValue;
0 commit comments