Hi I am developing angular with web API application. I am trying receive object with array from angular. Unfortunately I am receiving null in the array.
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;
}
In web API i have below class
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; }
}
When I send above request object I will receive null in templates.
public HttpResponseMessage Put(int id, updatercvparams obj)
May I know, Am I missing anything here?