检索mehod中wcf服务的参数值 [英] Retrieve parameter values of wcf service inside the mehod

查看:93
本文介绍了检索mehod中wcf服务的参数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个输入参数的服务合约,我想获得方法本身内部的值

I have service contract with two input parameters and i want to get the value of those inside the method itself

public string Test(string data, List<int> members) {

// 这里我想将所有输入参数存储在具有键值对的字典中

//使用辅助方法而不是手动执行。
return" result is"+ data;
}

我们可以这样做吗?

推荐答案

您好Vivekh RF,

Hi Vivekh RF,

根据您的描述,我创建了一个类似下面的演示供您参考。

Based on your description, I create a demo like below for your reference.

public static void Test(string data, List<int> members)
        {
            Dictionary<string, object> dic = new Dictionary<string, object>();
            dic.Add("data", data);
            dic.Add("members", members);
        }

如果我无法理解你的意思,请告诉我。

If I couldn’t understand what you mean, please let me know.

祝你好运,

Cole Wu


这篇关于检索mehod中wcf服务的参数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆