Skip to content
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

Add and use InvokeAsLambda extension methods for MethodInfo #298

Closed
YevgeniyShunevych opened this issue Aug 23, 2019 · 0 comments

Comments

@YevgeniyShunevych
Copy link
Member

commented Aug 23, 2019

Add extensions methods to MethodInfoExtensions:

public static void InvokeAsLambda(this MethodInfo method, object instance, params object[] args);

public static TResult InvokeAsLambda<TResult>(this MethodInfo method, object instance, params object[] args);

public static MethodCallExpression ToInstanceMethodCallExpression(this MethodInfo method, object instance, params object[] args);

Update occurences that use MethodBase.Invoke to use InvokeAsLambda to avoid TargetInvocationException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.