Could I get some help with this issue please:
I'm trying to send an array of int from my javascript function to my api controller but can't get the correct configuration for the controller - the projectsId passed into the controller is always null.
Javascript function:
getProducts: function (projects) {
return $http({
method: 'POST',
url: '/api/settings/products',
data: projects
}).then(function (result) {
return result.data;
}, function (result) {
return result;
});
The projects being passed ito getProducts is an int array.
Controller:
[HttpPost]
[Route("products")]
public IHttpActionResult Export([FromBody] int[] projectIds)
{
var exportProducts = new List<Product>();
Thank you.