Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 348
snakile Avatar asked Aug 08 '26 01:08

snakile


1 Answers

Easy:

theMethod.ReturnType == typeof(void)
like image 118
mmx Avatar answered Aug 10 '26 14:08

mmx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!