Domanda

Ho creato un'istanza di MethodInfo:

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

Ora voglio sapere se il tipo restituito dal metodo è nullo. Come?

È stato utile?

Soluzione

Facile:

theMethod.ReturnType == typeof(void)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top