Execute method with Action<T> argument using Reflection
- by JGr
How can i create a Action method to use as a argument to the following function?
public void When(Action<T> action)
{
if (internalValue != null)
action(internalValue);
}
I have the MethodInfo on the method, and the parameter type like so:
var methods = value.GetType().GetMethods();
MethodInfo mInfo = methods.First(method…