Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何检查服务方法';s参数类型是给定参数';什么是参数信息?_C#_.net_Wcf_Types_Parameters - Fatal编程技术网

C# 如何检查服务方法';s参数类型是给定参数';什么是参数信息?

C# 如何检查服务方法';s参数类型是给定参数';什么是参数信息?,c#,.net,wcf,types,parameters,C#,.net,Wcf,Types,Parameters,给定服务方法的参数中的某个参数,我想检查该参数是否为输出类型。检查其参数类型是否在末尾包含&符号就足够了吗?我注意到像System.String这样的对象在成为输出类型时会变成System.String&,或者,有没有更好的方法来检查这一点?参数信息p= bool isOutParam=(p.Attributes&System.Reflection.ParameterAttributes.Out)=System.Reflection.ParameterAttributes.Out 您的意思是该属

给定服务方法的参数中的某个参数,我想检查该参数是否为输出类型。检查其
参数类型
是否在末尾包含
&
符号就足够了吗?我注意到像
System.String
这样的对象在成为输出类型时会变成
System.String&
,或者,有没有更好的方法来检查这一点?

参数信息p=


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

您的意思是该属性是否使用
out
关键字?或者:
bool isOutParam=p.IsOut