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?

有帮助吗?

解决方案

It should be used with ByReferenceType like below

(parameter.ParameterType as ByReferenceType).ElementType.IsGenericInstance

Afterwards I am getting correct IsGenericInstance value

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top