将字典传递给客户端

| 我在客户端收到包含以下结构的字典
Dictionary<string,List<QuestionPropertyValue>> inputMap = new Dictionary<string,List<QuestionPropertyValue>>();
List<QuestionPropertyValue> questions = new List<QuestionPropertyValue>();
questions.Add(new QuestionPropertyValue(){QuestionName=\"USINSTR0208\",PropertyName=\"Value\",Value=\"Yes\"});
inputMap.Add(\"key1\", questions); 
如何在客户端找到有关“ key1”的问题? 当我调试时,我发现字典被转换为包含对象列表的对象,每个对象包含一个问题列表,当我用谷歌搜索时,我发现字典在客户端变成了关联数组,但我根本找不到它。 欢迎所有想法     
已邀请:
尝试使用Dictionary接口的
Item
属性来获取关联的项目:
var d = new ActiveXObject(\"Scripting.Dictionary\");

d.Add(\'a\', \'foo\');
d.Add(\'b\', [1, 2, 3]);

d.Item(\'a\'); // => \"foo\"
d.Item(\'b\'); // => [1,2,3]
d.Item(\'b\')[0]; // => 1
在您的示例中,看起来您可以执行以下操作:
var questions = inputMap.Item(\'key1\');
questions[0]; // => QuestionPropertyValue[QuestionName=\"USINSTR0208\"...]
    

要回复问题请先登录注册