C # MethodInfo getReturnType
-
06-07-2019 - |
سؤال
وأنا إنشاء مثيل من MethodInfo:
MethodInfo theMethod = typeof(Reciever).GetMethod("methodName", parameterTypes);
والآن أريد أن أعرف إذا كان نوع الإرجاع theMethod هو باطل. كيف؟
المحلول
من السهل:
theMethod.ReturnType == typeof(void)
لا تنتمي إلى StackOverflow