Search code examples
c#.netreflectionvoidmethodinfo

C# MethodInfo getReturnType


I created an instance of MethodInfo:

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

Now I want to know if theMethod's return type is void. How?


Solution

  • Easy:

    theMethod.ReturnType == typeof(void)