My JavaScript array is structured like this:
[[2,3],[13,4],[1,19]]
I need to send it to my .Net controller.
The header of my controller function is as follows:
public async Task<ActionResult> UpdateOrder(int[,] order)
This is how I make the PUT call:
updateOrder(order: number[][]): Observable<any> {
return this.http.put(this.baseUrl + 'members/edit/set-order/' + order, {});
}
Unfortunately, when I try to access the controller, I encounter an error message:
'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Int32[,]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.\nTo fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.\nPath '', line 1, position 2.'