Skip to content

Commit

Permalink
Apply @adecler's suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Arnaud Declercq <[email protected]>
  • Loading branch information
2 people authored and Fraser Greenroyd committed Feb 24, 2021
1 parent 9474f31 commit 4c4505f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Reflection_Engine/Query/ExtensionMethodToCall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static partial class Query
[Input("target", "First argument of the method to find.")]
[Input("methodName", "The name of the method to be sought.")]
[Output("method", "Most suitable extension method with requested target, name and parameters. If no method was found, null is returned.")]
public static MethodInfo ExtensionMethodToCall(object target, string methodName)
public static MethodInfo ExtensionMethodToCall(this object target, string methodName)
{
return ExtensionMethodToCall(methodName, new object[] { target });
}
Expand All @@ -54,7 +54,7 @@ public static MethodInfo ExtensionMethodToCall(object target, string methodName)
[Input("methodName", "The name of the method to be sought.")]
[Input("parameters", "The additional arguments of the call to the method, skipping the first argument provided by 'target'.")]
[Output("method", "Most suitable extension method with requested target, name and parameters. If no method was found, null is returned.")]
public static MethodInfo ExtensionMethodToCall(object target, string methodName, object[] parameters)
public static MethodInfo ExtensionMethodToCall(this object target, string methodName, object[] parameters)
{
return ExtensionMethodToCall(methodName, new object[] { target }.Concat(parameters).ToArray());
}
Expand Down Expand Up @@ -161,4 +161,3 @@ private static void StoreExtensionMethod(Tuple<Type, string> key, MethodInfo met
}
}


0 comments on commit 4c4505f

Please sign in to comment.