[英]How do I check if a service method's parameter type is an output type given the parameter's ParameterInfo?
给定服务方法的参数中的ParameterInfo ,我想检查此参数是否为输出类型。 检查其ParameterType
是否在结尾处包含&
符号是否足够? 我注意到像System.String
这样的对象在成为输出类型时会变成System.String&
,或者,有没有更好的方法来检查这一点?
ParameterInfo p = ...;
bool isOutParam =(p.Attributes&System.Reflection.ParameterAttributes.Out)== System.Reflection.ParameterAttributes.Out;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.