GooglePrettify

2017年6月22日 星期四

How to use reflection to call method by name


35down voteaccepted
Something along the lines of:
MethodInfo method = service.GetType().GetMethod(serviceAction);
object result = method.Invoke(service, new object[] { request });
return (R) result;

from : https://stackoverflow.com/questions/3110280/how-to-use-reflection-to-call-method-by-name

沒有留言:

張貼留言