我有两个模型:
交易:
public class Transaction
{
public string Part { get; set; }
public string Description { get; set; }
public IEnumerable<LotNum> LotsList { get; set; }
}
批号:
public class LotNum
{
public string LOTNUM { get; set; }
public string LOTQTY { get; set; }
}
控制器动作:
[HttpPost]
public HttpResponseMessage ProcessTransaction(Transaction model)
{
}
当我通过 Ajax 调用将参数传递给此操作时,LotsList 属性值将始终为空:
var me = this,
values = me.getValues();
values.Part = 'R001';
values.Description = 'Sample Desc';
values.LotsList = [{
"LOTNUM": "L7",
"LOTQTY": "5"
},
{
"LOTNUM": "L8",
"LOTQTY": "5"
}];
Ext.Ajax.request({
dataType: 'JSONP',
url: '/Base/ProcessTransaction',
params: values,
method: 'POST',
success: function (response) {
},
failure: function (response) {
}
});
请让我知道我缺少什么以及如何解决我的问题?谢谢。