How to determine if ParameterInfo is of generic type?

后端 未结 4 972
自闭症患者
自闭症患者 2020-12-19 07:42

I have a MethodInfo of a GenericMethodDefinition. Such as: CallMethod(T arg, string arg2). The GetParameters() method will give me two P

4条回答
  •  半阙折子戏
    2020-12-19 07:58

    I think you are looking for these:

    parameterInfo.ParameterType.ContainsGenericParameters
    parameterInfo.ParameterType.GetGenericParameterConstraints()
    

提交回复
热议问题