Javascript 反序列化字典返回空对象的列表
我正在向.NETAPI发送JSON 后端结构如下所示:Javascript 反序列化字典返回空对象的列表,javascript,c#,.net,json,entity-framework,Javascript,C#,.net,Json,Entity Framework,我正在向.NETAPI发送JSON 后端结构如下所示: public class ImportData { public ImportData() { this.ActionList = new List<ApplicationVersionExecutableActionsDTO>(); this.ReqList = new List<ApplicationHardwareRequirementsDTO>();
public class ImportData
{
public ImportData()
{
this.ActionList = new List<ApplicationVersionExecutableActionsDTO>();
this.ReqList = new List<ApplicationHardwareRequirementsDTO>();
this.BlockList = new List<ConfiguratorBlocksDTO>();
this.targetFileErrors = new List<Dictionary<string, string>>();
}
public List<ApplicationVersionExecutableActionsDTO> ActionList { get; set; }
public List<ApplicationHardwareRequirementsDTO> ReqList { get; set; }
public List<ConfiguratorBlocksDTO> BlockList { get; set; }
public List<Dictionary<string, string>> targetFileErrors { get; set; }
}
public class ImportConflict
{
public ImportData replaceLists { get; set; }
public ImportData addLists { get; set; }
public int appVersionID { get; set; }
}
以下是发送前json的外观:
我做过好几次这样的事情,但我不明白这件事有什么不对 JSON不作为图像:
{
"replaceLists": {
"ActionList": [],
"ReqList": [],
"BlockList": [],
"targetFileErrors": [
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "appAtract3.xml",
"$$hashKey": "object:346",
"resolvedBy": "1"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "appAtract3.js",
"$$hashKey": "object:347",
"resolvedBy": "1"
}
],
"targetAssetErrors": []
},
"addLists": {
"ActionList": [],
"ReqList": [],
"BlockList": [],
"targetFileErrors": [
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "CameraInput3.js",
"$$hashKey": "object:340",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "FxMill3_x64_644.zip",
"$$hashKey": "object:341",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "FxMill-ConfigUpdater-644.zip",
"$$hashKey": "object:342",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "init_template3.js",
"$$hashKey": "object:343",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "ScreenOutput3.js",
"$$hashKey": "object:344",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "AtraTools.zip",
"$$hashKey": "object:345",
"resolvedBy": "0"
}
],
"targetAssetErrors": []
},
"appVersionID": 243
}
请将JSON作为代码块发布,而不是imageTry更改为Dictionary。添加了代码块。我真的不想把它改成字典
{
"replaceLists": {
"ActionList": [],
"ReqList": [],
"BlockList": [],
"targetFileErrors": [
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "appAtract3.xml",
"$$hashKey": "object:346",
"resolvedBy": "1"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "appAtract3.js",
"$$hashKey": "object:347",
"resolvedBy": "1"
}
],
"targetAssetErrors": []
},
"addLists": {
"ActionList": [],
"ReqList": [],
"BlockList": [],
"targetFileErrors": [
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "CameraInput3.js",
"$$hashKey": "object:340",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "FxMill3_x64_644.zip",
"$$hashKey": "object:341",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "FxMill-ConfigUpdater-644.zip",
"$$hashKey": "object:342",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "init_template3.js",
"$$hashKey": "object:343",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "ScreenOutput3.js",
"$$hashKey": "object:344",
"resolvedBy": "0"
},
{
"sourceContainer": "da-files-7",
"targetContainer": "da-files-3",
"fileName": "AtraTools.zip",
"$$hashKey": "object:345",
"resolvedBy": "0"
}
],
"targetAssetErrors": []
},
"appVersionID": 243
}