Finally, I have been able to get through reflection, a member of type Func<T, TResult>
, now, how do I invoke it?
When I retrieve it, I do it through the Type.GetMembers method, and that returns a MemberInfo type that does not have a Invoke method; how can I invoke it?
Again people, thanks in advance! =)
Once you've got an instance of Func<T, TResult>
, you can cast it to a Delegate
, and call the DynamicInvoke
method on it which allows you to call the delegate in a reflection scenario (as long as the argument types match!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With