我有以下 JSON 用于定义表单,但每个“部分”(例如培训、教育)不在数组中。
我需要将每个顶部部分(例如培训等)转换为 C#Section类,以及该 a 下的字段List<Field>等,以便随后可以呈现它。
这是我正在使用的 JSON。我尝试了各种反序列化方法,但都没有奏效。
{
"readonly": "True",
"Training": {
"entity": "PNLCAND",
"type": "standard",
"mode": "update",
"fields": {
"HEADER_3": {
"caption": "Please enter all relevant work related courses",
"type": "header",
"update": "",
"mandatory": false,
"tooltip": ""
},
"HEADER_5": {
"caption": "",
"type": "header",
"update": "",
"mandatory": false,
"tooltip": ""
},
"HEADER_6": {
"caption": "",
"type": "header",
"update": "",
"mandatory": false,
"tooltip": ""
}
}
},
"Education": {
"entity": "PNLCANQUA",
"type": "repeating",
"mode": "update",
"fields": {
"Q_SUBJECT": {
"caption": "Qualifications gained",
"type": "string",
"length": 40,
"update": "Y",
"mandatory": false,
"tooltip": ""
},
"TO_DATE": {
"caption": "Date Awarded/Expected",
"type": "date",
"range": {
"start": -60,
"end": 0
},
"update": "Y",
"mandatory": false,
"tooltip": ""
},
"Q_GRADE": {
"caption": "Grade/Level",
"type": "string",
"length": 40,
"update": "Y",
"mandatory": false,
"tooltip": ""
},
"Q_LOCATION": {
"caption": "School / Colleges, Universities or Institutes of Further Education",
"type": "string",
"length": 40,
"update": "Y",
"mandatory": false,
"tooltip": ""
}
},
"values": [
{
"TO_DATE": "2019-08-01",
"Q_SUBJECT": "Qual 1",
"Q_LOCATION": "School",
"Q_GRADE": "a",
"UDF_6_EDU001": "C"
},
{
"TO_DATE": "2019-08-01",
"Q_SUBJECT": "Qual 2",
"Q_LOCATION": "School",
"Q_GRADE": "a",
"UDF_6_EDU001": "C"
},
{
"TO_DATE": "2019-08-31",
"Q_SUBJECT": "Qual 3",
"Q_LOCATION": "Uni",
"UDF_6_EDU001": "U"
}
]
},
}