6
這才能發佈,爲departments
是null
如何發佈集合使用Restangular.Js到的WebAPI
JavaScrtipt代碼服務器:
var departments = [{ DepartmentName : "Name", DepartmentId : 1}];
Restangular.all('records/StartNewDate').post(departments);
網絡API控制器
public HttpResponseMessage StartNewDate(DepartmentViewModel[] departments)
{
....
....
}
服務器模型
public class DepartmentViewModel
{
public int DepartmentId { get; set; }
public string DepartmentName { get; set; }
}
後的有效載荷超過線什麼。看看在鉻開發控制檯。 – Chandermani