【发布时间】:2017-09-12 07:27:30
【问题描述】:
我想传递数据,这里有孩子的列表
{
id : 1,
title : 'test',
childs : [
{ id : 1, name: 'name1' },
{ id : 2, name: 'name2' },
{ id : 3, name: 'name3' }]
}
我希望它传递给 web api 控制器
public IHttpActionResult Post(Batche model){
return model;
}
和批处理
public class Batche
{
public long Id { get; set; }
public string title{ get; set; }
public ICollection<BatchDetail.BatchDetail> BatchDetails { get; set; }
}
和批次详情
public class BatchDetails(){
public long Id { get; set; }
public string Name{ get; set; }
}
当我发布数据时让我为空
$http({
method : 'POST',
url : baseUrl + "api/MyController",
data : $scope.model
})
【问题讨论】:
标签: c# angularjs asp.net-web-api pass-data