在C#中创建自定义JSON数组

时间:2017-07-06 16:01:06

标签: asp.net json

您好我有一个SQL服务存储过程,它返回如下数据(请参见下图)。 enter image description here

我想创建一个类似于下面的JSON数组 -

blankForms = [{
                    "category":"IT Requisition",
                    "forms":[{
                                "formId":"29C37639-C4F3-4F0E-B7BD-8823B73B92A1",
                                "formName":"Employee_Details.doc",
                                "formDescription":"Employee Joining Details Form 3",
                                "contentType":"application/msword",
                                "companyId":3,
                                "lastUpdated":"2017-07-06",
                                "uploadedByUserId":"0500178"
                            },
                            {
                                "formId":"85470C02-9255-4F46-99D5-5E80DA58A026",
                                "formName":"Employee_Details.doc",
                                "formDescription":"Employee Details Form",
                                "contentType":"application/msword",
                                "companyId":3,
                                "lastUpdated":"2017-07-06",
                                "uploadedByUserId":"0500178"
                            }]
                },
                {
                    "category":"Employee Joining",
                    "forms":[{
                                "formId":"94D7A0D5-43D1-47EC-9E5D-3E9873932419",
                                "formName":"IT Info Sheet 59.pdf",
                                "formDescription":"IT Requisition Form",
                                "contentType":"application/pdf",
                                "companyId":3,
                                "lastUpdated":"2017-07-06",
                                "uploadedByUserId":"0500178"
                            }]
                }]

知道如何在C#中做到这一点。请建议。

0 个答案:

没有答案