这是我尝试POST的JSON数据:
{
"UploadText": [
[
"Stamp Duty+Rgst",
"Extra on actuals (approximately @ 5.9%)",
"4.90%",
"",
"688,225",
"",
"",
"688,225"
],
[
"share certificate",
"250",
"",
"",
"250",
"",
"",
"250"
],
[
"Legal charges",
"Lumpsum (Approx 10 - 20k)",
"",
"",
"",
"",
"18,000",
"18,000"
],
[
"TOTAL",
"",
"",
"",
"16,122,863",
"",
"5,564,372",
"21,687,235"
]
]
}
这是我的控制器方法:
public void UploadText(UploadItem uploadItem)
{
}
这是实际的课程:
public class UploadItem
{
public List<string[]> UploadText { get; set; }
}
我正在尝试使用Angular发布数据并且请求发送正确。但是模型绑定没有正确发生。 UploadText
内的UploadItem
始终为NULL。如果我更改为List<List<string>>
,它仍为NULL。我做错了什么?
答案 0 :(得分:0)
:
"UploadText":
到
"uploadItem":
因为这是预期的参数,请看下面的内容:
public void UploadText(UploadItem uploadItem)