我以下面给出的方式调用web api
$scope.workOrder = {};
$scope.workOrder.assignedName = "Dummy"
dbSrvc.getDatFromService('../../api/DispatchNotifyService/GetWorkOrders', $scope.workOrder).then(function (result) {
$scope.workOrderList = result.data;
$scope.workOrderNumberLabel = $scope.workOrderList[0].workOrderNumber;
$scope.workOrderpriority = $scope.workOrderList[0].priority;
$scope.getEmployeeDetailsDO(null);
});
调用API但参数未获取值.Its值始终为null。 我使用角度js来调用Web API。请帮帮我。
这是我的服务器代码。
[HttpGet]
public ICollection<WorkOrder> GetWorkOrders(WorkOrder workOrder)
{
this.Initialize();
List<string> lstWorkOrder = JsonConvert.DeserializeObject<List<string>>(this.sessionObject.WorkOrderDetails);
ICollection<WorkOrder> workOrderCollection = new Collection<WorkOrder>();
lstWorkOrder.ToList().ForEach(delegate(string wo)
{
WorkOrder workOrderDetails = JsonConvert.DeserializeObject<WorkOrder>(wo);
workOrderCollection.Add(workOrderDetails);
});
return workOrderCollection;
}