1
您好我正在开发与Web API应用程序的角度。我试图从角度接收数组的对象。不幸的是我在阵列中收到null
。angularjs发送嵌套的对象到API
this.updateprocesswithtemplates = function() {
var sub = {
projectId: "50",
code: "app",
templates: {
title: "templatetiltle",
version: "templateversion",
visible: "templatevisible",
templatefileid: "31",
displayorder: "1"
}
};
var responseservice = $http.put('/api/processes/81/', sub).success(function (response) {});
return responseservice;
}
在网络API我具有低于类
public class updatercvparams
{
public string projectId{ get; set; }
public int code { get; set; }
public templates[] templates { get; set; }
}
public class templates
{
public string title { get; set; }
public string version { get; set; }
public int displayorder { get; set; }
public string visibility { get; set; }
public int templatefileid { get; set; }
}
当我发送上述请求对象,我将在模板接收null
。
public HttpResponseMessage Put(int id, updatercvparams obj)
我可以知道,我在这里丢失了什么吗?
感谢。有效... –