문제

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