【发布时间】:2017-05-07 17:38:14
【问题描述】:
我们在 WebAPI 上有一个方法,我们从 angularjs 调用它,我们希望将 json 数据作为参数传递并在 WebAPI 方法中将其作为对象接收。
AngularJS 调用
@ 987654321@$http.post('/EmployeeArrivalDetails/UpdateEmployeeApprovalStatus/', empInfo).
then(function (response) {
}, function (response) {
});
WebAPI方法[HttpPost]public ReturnResponse UpdateEmployeeApprovalStatus(Employee employeeInfo)
{
}
【问题讨论】:
-
您构造
employeeInfo实例,然后将empInfo传递给操作。 -
是的,我们已经改变了。谢谢
标签: c# .net angularjs asp.net-web-api