如何从 Dictionary 对象创建一个 json 结构?

时间:2021-02-02 13:31:51

标签: c# asp.net json dictionary

我正在尝试从字典 Dictionary() 创建一个 json。输入字典包含作为键值对的数据,应从中创建 json

summary: summaryValue,
project: projectValue
priority:priorityValue
Requestor:RequestorValue,
issue:issueValue,
labels: LabelValue,
customfield_xyz:customfield_xyzValue,

我期望的json结构如下所示:

{
  "fields": {
    "summary": "summaryValue",
    "project": {
      "key": "projectValue"
    },
    "priority": {
      "name": "priorityValue"
    },

    "Requestor": {
      "name": "RequestorValue"
    },
    
    "issue": {
      "name": "issueValue"
    },
    "labels": "LabelValue",
    "customfield_xyz": "customfield_xyzValue"
  }
}

0 个答案:

没有答案