C # MethodInfo getReturnType

I created an instance of MethodInfo:

MethodInfo theMethod = typeof(Reciever).GetMethod("methodName", parameterTypes);

Now I want to know if the type of the returned method is invalid. How?

+3
source share
1 answer

Easily:

theMethod.ReturnType == typeof(void)
+11
source

Source: https://habr.com/ru/post/1710781/


All Articles