【发布时间】:2016-05-19 14:41:12
【问题描述】:
我想从我的 c# 控制器中的 Json 数组中检索值。这是我的 json 数组:
{
name : "Name 1",
description : "Description 1",
count : 6
}
如何在我的 c# 控制器中检索每个属性?如果我处理对象,我知道该怎么做,但这个 json 不是来自对象。
public IList[] getList(IList[] myList)
{
// How to get the value of the name and the description here ?
}
【问题讨论】:
-
完成一个简单任务的代码太多了!我最终将创建一个包含我需要的所有属性的类,然后以这种方式检索它们:myList.name、myList.description 等。