0

Given a certain ParameterInfo from the parameter of a service method, I would like to check if this parameter is an output type. Would it be enough to check if its ParameterType contains an & sign at the end? I've noticed objects like System.String become System.String& when they are output types, or, is there a better way to check for this?

4

1 回答 1

1

参数信息 p = ...;

bool isOutParam = (p.Attributes & System.Reflection.ParameterAttributes.Out) == System.Reflection.ParameterAttributes.Out;

于 2013-01-31T17:41:06.053 回答