There is problem in sending ajax requests that have multiple parameters to asp.net mvc core 3 action using http post method. the parameters do not bind. In dot net framework asp.net web api there was similar limitation but not in asp.net mvc actions. I want to know is there work around this in asp.net core 3 mvc or is this the new limitation? action:
public string SomeAction([FromBody]string param1, [FromBody]IEnumerable<SomeType> param2, [FromBody]IEnumerable<SomeType> param3)
{
//param1 and param2 and param3 are null
}
client:
$.ajax({
contentType: 'application/json',
data: JSON.stringify({
"param1": "someString",
"param2": someList,
"param3": someList
}),
type: "POST",
dataType: "json",
url: "/SomeController/SomeAction",
success: function (result) {
},
error: function (error) {
console.error(error);
}
}
);