It should be used with ByReferenceType like below
(parameter.ParameterType as ByReferenceType).ElementType.IsGenericInstance
Afterwards I am getting correct IsGenericInstance value
Question
I have below method with nullable parameters in which 2nd one is out too
public static void MyMethod(Nullable<System.Int32> i_ReportID, out Nullable<System.Int32> i_MenuID)
{
i_MenuID = 0;
}
I tried to identify the parameter as a GenericInstance by
(methodDefinition.Parameters[0] as ParameterReference).ParameterType.IsGenericInstance For 1st parameter and it's returns true. (methodDefinition.Parameters[1] as ParameterReference).ParameterType.IsGenericInstance For 2nd parameter and it's returns false. Why?
Solution
It should be used with ByReferenceType like below
(parameter.ParameterType as ByReferenceType).ElementType.IsGenericInstance
Afterwards I am getting correct IsGenericInstance value